RankBars
Horizontal ranking for the Industry theme.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
Horizontal ranking for the Industry theme.
Accessibility
Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.
Install and import
npx shadcn@latest add @prism/rank-bars
import { RankBars } from '@/components/prism/RankBars';
In a no-build prototype, read it from the bundle instead: const { RankBars } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
data | RankDatum[] | — | |
sort | boolean | — | Sort descending by value (default). Pass false to keep source order. |
colorByRank | boolean | — | Step down the hue family by rank, brightest first. |
color | string | — | Single colour when colorByRank is false. |
formatValue | (v: number) => React.ReactNode | — | |
caption | string | — |