Skip to main content

DonutChart

Proportional donut (pie when thickness = size/2).

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

When to use​

Proportional donut (pie when thickness = size/2).

Accessibility​

Each chart ships an accessible fallback (a visually-hidden data table / aria-label summary) so the data is available to screen readers, not just sighted users. Colour is paired with shape/label, never used alone.

Install and import​

npx shadcn@latest add @prism/donut-chart
import { DonutChart } from '@/components/prism/DonutChart';

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

Examples​

With center label

<DonutChart data={mix} centerValue="766" centerLabel="SKUs" />

Props​

PropTypeRequiredDescription
dataDonutDatum[]Yes
sizenumber—
thicknessnumber—
centerValueReact.ReactNode—
centerLabelReact.ReactNode—
showLegendboolean—
formatValue(v: number) =&gt; React.ReactNode—
captionstring—