Bar list
v0.64.0, changelogA short ranked list of counts with no chart library: each row a label, a value and a --chart-1 bar scaled to the largest, with optional links and "N more" and no surface of its own.
In card
Install
npx shadcn add @syncrobotic/bar-list Also installs: @syncrobotic/cn, @syncrobotic/empty-state, @syncrobotic/format-number
Overview
When to use
- "Items by class" or "files by format" on a dataset's card, the top 5 to 10.
- Several small rankings on one data page, each inside its own card.
- The top classes of a row, inside a table cell.
- Rows that lead to the list filtered to them, with
href.
Which one: MetricCard, Meter, ShareBar, BarList or Chart
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Compact
In table
Zh tw
Empty
Usage rules
- For items per class, files per format, the top 5 to 10. Pass the rows in the order to show them, largest first;
maxshows that many, then says how many more. - One series: every bar is
--chart-1, scaled to the largest value. No status colours, no colour per row; a row that needs attention says so in words elsewhere. - The value is written in each row (tabular, with
locale;formatto shorten it), so it needs no Chart / Table switch, as a sparkline does. - No surface of its own: put it in a Card (with CardDataHeader naming it), a table cell or a sheet.
labelnames the list for screen readers; show the same words as the card's title. - Give a row
hrefwhen it leads to a view of that item (the list filtered to it): the whole row is the link, 36 px tall (44 on touch). PasslinkAsfor your router. - A level against a known range (storage, a quota) is a Meter; values over time or a chart people explore is
chart(bar-chart-ranked).
Changelog
- 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
- 0.58.02026-11-28Stable: shipped ten releases with no breaking change, with unit tests, measured accessibility (components) and use/instead docs. Its API now changes only after a release deprecates what goes, with a migration line.
- 0.53.02026-11-27Its doc opens with its description, word for word; the code is unchanged.