Skip to main content

RankBars

Horizontal ranking for the Industry theme.

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

When 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​

PropTypeRequiredDescription
dataRankDatum[]—
sortboolean—Sort descending by value (default). Pass false to keep source order.
colorByRankboolean—Step down the hue family by rank, brightest first.
colorstring—Single colour when colorByRank is false.
formatValue(v: number) => React.ReactNode—
captionstring—