A single-series bar chart, in the same two rendering modes every chart in this system will
eventually offer: "bitmap" quantizes each bar into discrete filled/empty cells — the same
segmented-gauge look as Meter, no bitmap equivalent for a sub-cell-height
bar — and "precise" renders an exact, continuous height instead.
Monochrome, like the rest of this system — there's no second color to distinguish a second series with, so this stays single-series; a grouped/stacked variant would need a non-color differentiator (pattern fills, most likely) to fit the palette.
| Label | Value |
|---|---|
| Jan | 12 |
| Feb | 28 |
| Mar | 19 |
| Apr | 34 |
| May | 22 |
<BarChart label="Monthly signups" showValues />Accessibility
A chart's visual plot is marked role="img" with your label as its accessible name — the bars
themselves aren't independently announced, the same reasoning Meter uses for its segmented track.
The real numbers stay available as a visually-hidden <table> alongside it, so a screen reader user
gets the underlying data rather than just a summary.
Examples
mode="precise" renders an exact height instead of quantizing to whole cells:
| Label | Value |
|---|---|
| Jan | 12 |
| Feb | 28 |
| Mar | 19 |
<BarChart
label="Monthly signups"
mode="precise"
data={[
{ label: "Jan", value: 12 },
{ label: "Feb", value: 28 },
{ label: "Mar", value: 19 },
]}
/>max sets what the tallest bar represents — pass it explicitly when the chart should read against a
target rather than its own data's max:
| Label | Value |
|---|---|
| Alpha | 40 |
| Beta | 85 |
| Gamma | 15 |
<BarChart
label="Storage used per project (GB)"
max={100}
data={[
{ label: "Alpha", value: 40 },
{ label: "Beta", value: 85 },
{ label: "Gamma", value: 15 },
]}
/>valueFormatter controls how numbers render, both in showValues' labels and in the hidden data
table:
<BarChart
label="Conversion rate by channel"
showValues
valueFormatter={(value) => `${value}%`}
data={[
{ label: "Organic", value: 4.2 },
{ label: "Paid", value: 2.8 },
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| className | text | — | — |
| data * | readonly | — | — |
| height | number | 160 | Chart area height in px. |
| label * | text | — | Required: like `Meter`, a chart has no visible text of its own that describes what it shows — without this it's silently unreadable on a screen reader. |
| max | number | the data's own max | The tallest bar's value. |
| mode | bitmap | precise | "bitmap" | `"bitmap"` quantizes each bar into discrete filled/empty cells, the same segmented-gauge look as `Meter` — no bitmap equivalent for a sub-cell-height bar. `"precise"` renders an exact, continuous height instead. |
| segments | number | 10 | `"bitmap"` mode only: vertical cell count per bar. |
| showValues | boolean | false | Shows each bar's value above it. |
| valueFormatter | readonly | — | — |