RingChart
Extruded allocation ring for the Industry theme — the glossy exception in an otherwise matte system.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
Extruded allocation ring for the Industry theme — the glossy exception in an otherwise matte system.
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/ring-chart
import { RingChart } from '@/components/prism/RingChart';
In a no-build prototype, read it from the bundle instead: const { RingChart } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
data | RingDatum[] | — | |
activeIndex | number | null | — | Spotlight one segment by index; the rest dim. Default null (all lit). |
size | number | — | Outer diameter in px. |
thickness | number | — | Ring thickness in px. Thinner ring → larger clear centre for children. |
gap | number | — | Machined slot between segments, in degrees. |
value | React.ReactNode | — | Headline value shown at the centre. |
label | React.ReactNode | — | Small uppercase caption under the centre value. |
children | React.ReactNode | — | Custom centre content, sized to the ring's inner circle. Overrides value/label — use for a rich readout (a heading + a control), e.g. <RingChart …><strong>Growth 30%</strong><button>NVDA, GOOG +22 ›</button></RingChart>. |
showLegend | boolean | — | |
formatValue | (v: number) => React.ReactNode | — | |
caption | string | — | Accessible name and data-table caption. |