Bar chart
One metric over a period as bars, with a tooltip on the hovered one.
Covers
Oct 26 – Nov 1, 2026
- Sun
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
Installation
npm i @uisatin/uiimport { BarCard } from '@uisatin/ui/bar-chart'About 50.2 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.
npx shadcn@latest add https://uisatin.dev/r/bar-chart.jsonAdds bar-chart.tsx, badge.tsx, chart.tsx, dropdown.tsx, floating.tsx, form-field.tsx, kbd.tsx, labels.tsx, pointer-modality.tsx and select.tsx to components/ui.
First time with Satin? Set it up once, styles and fonts included, with the installation guide.
API Reference
The BarCard component is a wrapper around the div element with a title, a range, an optional period Select and the bars. New data regrows the bars from the baseline; reducedMotion (or the reader's reduced-motion setting) swaps them at once.
| Prop | Type | Default |
|---|---|---|
title | string | — |
range | string | — |
data | ChartDatum[] | — |
total | string | — |
change | string | — |
periods | string[]string[][] | — |
value | string | — |
onPeriodChange | (period) => void | — |
unit | string | — |
formatValue | (value) => string | — |
legend | { label, value?, note? } | — |
reducedMotion | boolean | — |
highlight | number | — |
Accessibility
The card is role="figure" labelled by its title. The bars are a list named after the title; each bar is a tab stop named "label: value unit", and focusing it shows its tooltip. The axis and grid lines are hidden. With periods, the Select in the header is named "Period".
| Key | Action |
|---|---|
| TaborShift+Tab | Moves from bar to bar and shows the focused bar’s value. |
Something wrong or missing on this page?
Report a problemSuggest an improvement