Charts
One component per chart, one shared set of axis props. Pass data with a label and a value for a single series, or add series when you compare several.
LineChart: one series
| Label | Value |
|---|---|
| Mon | 120 |
| Tue | 157 |
| Wed | 194 |
| Thu | 141 |
| Fri | 178 |
| Sat | 125 |
| Sun | 162 |
Component Source
<LineChart data={[{ label: "Mon", value: 120 }, { label: "Tue", value: 148 }]} />LineChart: area, no y axis
| Label | Value |
|---|---|
| Mon | 120 |
| Tue | 157 |
| Wed | 194 |
| Thu | 141 |
| Fri | 178 |
| Sat | 125 |
| Sun | 162 |
Component Source
<LineChart type="area" data={trend} height={120} showYAxis={false} />LineChart: step
| Label | Value |
|---|---|
| Mon | 40 |
| Tue | 40 |
| Wed | 65 |
| Thu | 65 |
| Fri | 65 |
| Sat | 30 |
| Sun | 30 |
Component Source
<LineChart curve="step" data={balance} />LineChart: several series
WebiOSAndroid
| Label | Web | iOS | Android |
|---|---|---|---|
| Mon | 120 | 60 | 30 |
| Tue | 157 | 113 | 59 |
| Wed | 194 | 96 | 38 |
| Thu | 141 | 79 | 67 |
| Fri | 178 | 62 | 46 |
| Sat | 125 | 115 | 75 |
| Sun | 162 | 98 | 54 |
Component Source
<LineChart data={rows} series={series} />LineChart: stacked area
WebiOSAndroid
| Label | Web | iOS | Android |
|---|---|---|---|
| Mon | 120 | 60 | 30 |
| Tue | 157 | 113 | 59 |
| Wed | 194 | 96 | 38 |
| Thu | 141 | 79 | 67 |
| Fri | 178 | 62 | 46 |
| Sat | 125 | 115 | 75 |
| Sun | 162 | 98 | 54 |
Component Source
<LineChart type="area" stacked data={rows} series={series} />BarChart: one series, per-bar tone
| Category | Value |
|---|---|
| Mon | 120 |
| Tue | 157 |
| Wed | 194 |
| Thu | 141 |
| Fri | 178 |
| Sat | 125 |
| Sun | 162 |
Component Source
<BarChart data={[{ label: "Mon", value: 24, tone: "success" }, { label: "Tue", value: 12 }]} />BarChart: negative values
| Category | Value |
|---|---|
| Mon | 24 |
| Tue | -12 |
| Wed | 31 |
| Thu | -8 |
| Fri | 17 |
| Sat | -22 |
| Sun | 9 |
Component Source
<BarChart data={[{ label: "Mon", value: 24 }, { label: "Tue", value: -12 }]} />BarChart: ranking
| Category | Value |
|---|---|
| /pricing | 4,200 |
| /docs/getting-started | 3,100 |
| /blog/launch | 1,800 |
| /changelog | 950 |
Component Source
<BarChart orientation="horizontal" data={ranked} yFormat="compact" />BarChart: compare two periods
This weekLast week
| Category | This week | Last week |
|---|---|---|
| Mon | 90 | 70 |
| Tue | 131 | 93 |
| Wed | 92 | 116 |
| Thu | 133 | 139 |
| Fri | 94 | 82 |
| Sat | 135 | 105 |
| Sun | 96 | 128 |
Component Source
<BarChart data={compare} series={[{ key: "thisWeek", name: "This week" }, { key: "lastWeek", name: "Last week", tone: "neutral" }]} />BarChart: horizontal and stacked
WebiOSAndroid
| Category | Web | iOS | Android |
|---|---|---|---|
| Mon | 120 | 60 | 30 |
| Tue | 157 | 113 | 59 |
| Wed | 194 | 96 | 38 |
| Thu | 141 | 79 | 67 |
| Fri | 178 | 62 | 46 |
| Sat | 125 | 115 | 75 |
| Sun | 162 | 98 | 54 |
Component Source
<BarChart orientation="horizontal" mode="stacked" data={rows} series={series} />Sparkline
Axis-free and decorative: it fills its container, so size it with className.
Component Source
<Sparkline data={[4, 7, 5, 9, 12, 10, 14]} className="h-10 w-32" />
<Sparkline type="bar" tone="success" data={[3, 5, 2, 8, 6, 9]} className="h-12 w-40" />Heatmap
| Row | 9 | 11 | 13 | 15 | 17 | 19 |
|---|---|---|---|---|---|---|
| Mon | 45 | 61 | 77 | 93 | 109 | 125 |
| Tue | 101 | 117 | 45 | 61 | 77 | 93 |
| Wed | 69 | 85 | 101 | 117 | 45 | 61 |
| Thu | 125 | 53 | 69 | 85 | 101 | 117 |
| Fri | 93 | 109 | 125 | 53 | 69 | 85 |
| Sat | 36 | 52 | 68 | 84 | 100 | 28 |
| Sun | 92 | 20 | 36 | 52 | 68 | 84 |
Component Source
<Heatmap rows={days} columns={hours} values={grid} />FunnelChart: both directions
1. Visited pricing24,800
2. Started sign-up6,900 · 72% drop
3. Verified email5,100 · 26% drop
4. Connected a source2,780 · 45% drop
5. Viewed dashboard2,310 · 17% drop
24,800
Visited pricing
100%
6,900−72%
Started sign-up
28%
5,100−26%
Verified email
21%
2,780−45%
Connected a source
11%
2,310−17%
Viewed dashboard
9.3%
Component Source
<FunnelChart steps={steps} />
<FunnelChart orientation="vertical" steps={steps} />DonutChart
| Segment | Value | Share |
|---|---|---|
| Free | 640 | 70% |
| Team | 210 | 23% |
| Business | 64 | 7% |
Component Source
<DonutChart centerLabel="Accounts" data={plans} />LineChart props
| Prop | Type | Default | Description |
|---|---|---|---|
| curve | "linear" | "smooth" | "step" | — | `step` holds each value until the next point (balances, plans, queue depth). |
| data* | Record<string, any>[] | — | One record per x position: `label` plus a number under each series `key` (`value` when `series` is omitted). |
| description | string | — | One-sentence takeaway, e.g. "Revenue doubled after the March launch." |
| height | number | — | Chart height in px (default 260). |
| padding | ChartPadding | — | Plot padding in px, merged over the defaults. |
| patterns | boolean | — | Tell series apart by more than colour: fill patterns on bars and slices, dashes and marker shapes on lines, repeated in the legend and tooltip (WCAG 1.4.1). Default true. Turn off only when every series is labelled directly on the chart. |
| series | SeriesSpec[] | — | Omit for a single series of `value`s. |
| showDots | boolean | true | Draw a dot on every point (default true when 16 points or fewer). |
| showGrid | boolean | — | — |
| showLegend | boolean | — | — |
| showXAxis | boolean | — | — |
| showYAxis | boolean | — | — |
| stacked | boolean | — | Stack the series on top of each other instead of overlaying them. |
| tickCount | number | — | Number of y-axis intervals (default 4, so 5 ticks). |
| title | string | — | Accessible name, e.g. "Monthly revenue, 2026". Read by screen readers and used as the data table caption. |
| type | "line" | "area" | — | `area` fills under each line (stacked areas when `stacked`). |
| xLabelEvery | number | — | Show every Nth x label, starting with the first (default 1). |
| xLabelEveryMobile | number | — | Below the md breakpoint show every Nth label instead (hides the rest on small screens). |
| xLabels | string[] | — | Explicit x labels to show (matched against each datum's `label`); overrides the stride props. |
| yFormat | "number" | "compact" | "currency" | "percent" | — | — |
| yMax | number | — | Fixed y-axis maximum; defaults to a rounded data maximum. |
| yPrefix | string | — | — |
| ySuffix | string | — | — |
* required
BarChart props
| Prop | Type | Default | Description |
|---|---|---|---|
| barGap | number | — | Gap between categories in px (default: 30% of the slot). |
| barRadius | ChartBarRadius | sm | Bar corner radius token (default "sm"). |
| data* | Record<string, any>[] | — | One record per category: `label` plus a number under each series `key`. Without `series`, the number is `value`, and a datum may carry its own `tone` or `color`. |
| description | string | — | One-sentence takeaway, e.g. "Revenue doubled after the March launch." |
| height | number | — | Chart height in px (default 260). |
| maxBarWidth | number | — | Maximum bar width in px. |
| mode | "grouped" | "stacked" | — | `grouped` puts the series side by side per category (comparison); `stacked` adds them up. |
| orientation | "vertical" | "horizontal" | — | `horizontal` puts categories on the y axis, good for long labels and rankings. |
| padding | ChartPadding | — | Plot padding in px, merged over the defaults. |
| patterns | boolean | — | Tell series apart by more than colour: fill patterns on bars and slices, dashes and marker shapes on lines, repeated in the legend and tooltip (WCAG 1.4.1). Default true. Turn off only when every series is labelled directly on the chart. |
| series | SeriesSpec[] | — | Omit for a single series of `value`s. |
| showGrid | boolean | — | — |
| showLegend | boolean | — | — |
| showXAxis | boolean | — | — |
| showYAxis | boolean | — | — |
| tickCount | number | — | Number of y-axis intervals (default 4, so 5 ticks). |
| title | string | — | Accessible name, e.g. "Monthly revenue, 2026". Read by screen readers and used as the data table caption. |
| xLabelEvery | number | — | Show every Nth x label, starting with the first (default 1). |
| xLabelEveryMobile | number | — | Below the md breakpoint show every Nth label instead (hides the rest on small screens). |
| xLabels | string[] | — | Explicit x labels to show (matched against each datum's `label`); overrides the stride props. |
| yFormat | "number" | "compact" | "currency" | "percent" | — | — |
| yMax | number | — | Fixed y-axis maximum; defaults to a rounded data maximum. |
| yPrefix | string | — | — |
| ySuffix | string | — | — |
* required
Sparkline props
| Prop | Type | Default | Description |
|---|---|---|---|
| data* | SparklinePoint[] | — | Numbers, or objects with a `value` (and an optional per-bar `tone` / `color`). |
| type | "line" | "area" | "bar" | line | Default "line". |
| tone | ChartTone | brand | Colour of the line, area or bars. Default brand. |
| curve | "linear" | "smooth" | smooth | Line and area only. Default "smooth". |
| barRadius | ChartBarRadius | sm | Bar corner radius token (default "sm"). |
| barGap | number | 4 | Gap between bars in px (default 4). |
| label | string | — | What the trend says, e.g. "Signups, up 12% this week". Makes the sparkline an image with that name; without it the sparkline is decorative (pair it with text nearby). |
* required
Heatmap props
| Prop | Type | Default | Description |
|---|---|---|---|
| rows* | string[] | — | — |
| columns* | string[] | — | — |
| values* | (number | null)[][] | — | `values[row][column]`. Use `null` for cells with no data (they stay empty, like the lower triangle of a cohort table). |
| tone | "brand" | "success" | "warning" | "danger" | — | Colour of the filled cells (a theme tone). |
| max | number | — | Value that maps to full intensity; defaults to the largest value. |
| format | ChartYFormat | — | — |
| showValues | boolean | true) | Print the value inside each cell (default true). |
| minColumnWidth | number | — | Narrowest a column may get before the heatmap scrolls sideways, in px. |
| labelWidth | string | — | Width of the row label column. |
| rowLabelTitle | string | — | — |
| title | string | — | Accessible name, used for the screen-reader table caption and the scroll region. |
* required
FunnelChart props
| Prop | Type | Default | Description |
|---|---|---|---|
| steps* | FunnelStep[] | — | — |
| orientation | "horizontal" | "vertical" | — | `horizontal` stacks a bar per step; `vertical` draws a column per step, left to right. |
| centered | boolean | — | `centered` (horizontal only) centres each bar so the stack narrows like a funnel. |
| height | number | — | Height of the columns in px (vertical). |
| showDropOff | boolean | true) | Show the drop-off between steps (default true). |
* required
DonutChart props
| Prop | Type | Default | Description |
|---|---|---|---|
| data* | DonutDatum[] | — | — |
| size | number | 160 | Diameter in px (default 160). |
| thickness | number | 18 | Ring thickness in px (default 18). |
| centerLabel | string | — | Small text in the centre, above the value. |
| centerValue | ReactNode | — | Large text in the centre. Defaults to the total. |
| showLegend | boolean | — | — |
* required