How a whole splits, as one thin bar in the chart palette (the accent, two greys, Other): light enough for a table cell, with an optional label, total and legend.
Install
npx shadcn add @syncrobotic/share-bar Also installs: @syncrobotic/cn
Overview
How a whole splits into a few parts, as one thin bar, light enough for a table cell.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Usage rules
- How a whole splits into a few parts (up to three, then “Other”): the first in the accent, then two greys, then the light grey for Other. For values over time or many categories, use a chart.
- Colours follow the order you give, never the size, and are never status colours.
- Outside a table cell, show the legend: identity never rests on colour alone. In a table, the column header names the parts.
Changelog
- 0.23.12026-11-21No unused React import, so the file compiles in projects with noUnusedLocals.
- 0.23.02026-11-20
localeformats the numbers and shares. - 0.22.02026-11-20Parts take the accent, two greys, then the Other grey for a fourth part and more (no fifth colour); "other" is --chart-4. The part not shown is its own track segment, so the 2 px gaps show the surface and Other never merges with the track.