BarChart
Categorical bar chart — single, grouped, or stacked — on the design-token palette.
Playground
- Revenue
- Cost
| Category | Revenue | Cost |
|---|---|---|
| Q1 | 42 | 30 |
| Q2 | 55 | 38 |
| Q3 | 48 | 41 |
| Q4 | 67 | 52 |
Loading...
Loading syntax highlighting...01 Examples
Grouped series
Two series rendered side by side per category — the default when each datum carries more than one value.
- Revenue
- Cost
| Category | Revenue | Cost |
|---|---|---|
| Q1 | €42k | €30k |
| Q2 | €55k | €38k |
| Q3 | €48k | €41k |
| Q4 | €67k | €52k |
Loading...
Loading syntax highlighting...Stacked
Set `stacked` to stack the series into one bar per category — useful for part-to-whole comparisons over time.
- Revenue
- Cost
| Category | Revenue | Cost |
|---|---|---|
| Q1 | €42k | €30k |
| Q2 | €55k | €38k |
| Q3 | €48k | €41k |
| Q4 | €67k | €52k |
Loading...
Loading syntax highlighting...Single series
One value per datum renders simple bars. The legend hides automatically with a single series.
| Category | Series 1 |
|---|---|
| Mon | 120 |
| Tue | 180 |
| Wed | 150 |
| Thu | 210 |
| Fri | 240 |
Loading...
Loading syntax highlighting...02 Customization
Custom series colors
Each series accepts an explicit `color` (any CSS color or design token) to override the cycled categorical palette.
- Revenue
- Cost
| Category | Revenue | Cost |
|---|---|---|
| Q1 | €42k | €30k |
| Q2 | €55k | €38k |
| Q3 | €48k | €41k |
| Q4 | €67k | €52k |
Loading...
Loading syntax highlighting...03 Accessibility
SVG with role="img"
The chart SVG carries role="img" and a generated aria-label summarising the category and series
count. Pass ariaLabel to override it with a domain-specific
description.
Data-table fallback
A visually hidden (sr-only) table mirrors the data
— one row per category, one column per series — so screen-reader users get the exact
values, not just the visual summary.
Per-bar tooltips
Each bar includes a native SVG <title> ("series
— category: value"), giving a zero-JavaScript hover tooltip that the browser also exposes to
assistive tech.
04 API Reference
16 props 1 required
Add filter
Grouping
Summary
Column visibility
No matching properties |
No matching properties
05 Installation
Import
Loading...
Loading syntax highlighting...