Skip to main content

BarList

A share-of-total breakdown: label, value, share and a proportional bar per row (each a role="meter").

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

A share-of-total breakdown: label, value, share and a proportional bar per row (each a role="meter").

Accessibility​

Rendered as a real <table> with header scopes; sortable columns expose aria-sort. Row selection and actions are keyboard reachable.

Install and import​

npx shadcn@latest add @prism/bar-list
import { BarList } from '@/components/prism/BarList';

In a no-build prototype, read it from the bundle instead: const { BarList } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
dataBarListItem[]Yes
totalnumber—The denominator for each row's share. Default: the sum of the values.
relativeTo"max" | "total"—Scale bars to the largest row ("max", default) or to the total ("total").
sortboolean—Largest first. Default true; pass false when the order means something.
showShareboolean—Show each row's share of the total as a percentage. Default true.
formatValue(value: number) =&gt; string—Formats each value. Default: locale number formatting.
tone"accent" | "positive" | "notice" | "negative" | "neutral"—
hue"rose" | "orange" | "amber" | "green" | "teal" | "blue" | "violet" | "magenta"—Paint the bar in a categorical hue (a module, a series) instead of a tone.
classNamestring—