Charts

Plots one or more lines on a 204px field. 1px grid, textured series, and one optional spot color.

SheetsProofssheets
Chart data of Sheets and Proofs, in sheets
LabelSheetsProofs
Mon124
Tue186
Wed155
Thu269
Fri247

Run

Sheets this week

Two textures on one field. Spot is a single Crouwel red — not a rainbow.

SheetsProofssheets
Chart data of Sheets and Proofs, in sheets
LabelSheetsProofs
Mon124
Tue186
Wed155
Thu269
Fri247

Use it for

  • Up to four series over time on one field; solid, dashed, gray, and dotted keep them apart without hue.
  • spot for the one accent the chart is allowed; Sparkline for a trend inside a row.

Not for

  • Categories; use BarChart.
  • More than four series; split them into SmallMultiples.

Three ways in. They share one source, so the pixels match whichever you pick.

1. Import the package

npm install @noorddev/vlak-react

// once, next to your app's root
import "@noorddev/vlak-react/css";

import { LineChart, Sparkline } from "@noorddev/vlak-react";

Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/chart.

2. Vendor the source

npx @noorddev/vlak-cli add chart

The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.

3. Through shadcn

npx shadcn add https://vlak.dev/r/chart.json

The same registry item, installed by shadcn's CLI.

CSS only

<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />

No React. Link vlak.css and use the markup and classes below.

import { LineChart, Sparkline } from "@noorddev/vlak-react";

<LineChart
  height={204}
  labels={days}
  series={[
    { name: "Sheets", values: sheets },
    { name: "Proofs", values: proofs },
  ]}
  unit="sheets"
  yLabel="Output"
  annotations={[{ at: 3, label: "Press" }]}
  spot
/>

<Sparkline values={[3, 5, 4, 8, 7, 9]} label="Sheets" unit="k" />

LineChart

PropTypeDefaultDescription
seriesrequiredChartSeries[]
labelsstring[]
heightnumber204
areabooleanFill under the first series. Prefer AreaChart for a dedicated area.
stackedboolean
invertedboolean
gridbooleantrue
ticksnumber4
unitstring
yLabelstring
xLabelstring
annotationsChartAnnotation[]
domain[number, number]
spotstring | boolean
valueFormat(value: number) => string
localestringBCP 47 tag for number formatting; undefined is the reader's own.

Also accepts HTMLAttributes<HTMLDivElement>.

Sparkline

PropTypeDefaultDescription
valuesrequirednumber[]
widthnumber120
heightnumber28
spotstring | boolean
labelstringWhat the trend is of; leads the accessible name and the table.
unitstring
localestringBCP 47 tag for number formatting; undefined is the reader's own.

Also accepts HTMLAttributes<HTMLSpanElement>.

KeysDoes
TabFocuses the plot
Arrow right, Arrow leftMoves the cursor across the points; a status tooltip reads the values
Home, EndFirst or last point
EscapeClears the cursor
<div class="rs-chart"><svg viewBox="0 0 240 64" width="240" height="64"><line class="rs-chart-grid" x1="0" x2="240" y1="56" y2="56"/><path class="rs-chart-line" d="M0 44 L40 36 L80 40 L120 22 L160 26 L200 12 L240 16"/></svg></div>
.rs-chart.rs-chart-canvas.rs-chart-line.rs-chart-grid.rs-chart-axis.rs-chart-bar.rs-spark.rs-chart-legend-svg.rs-chart-svg