Donut Breakdown
A ring of slices separated by surface gaps with a headline figure in the centre and a legend that carries every value.
Interactive preview · desktop · dark
Installation
Installation is available on the Startup and Business plans. Your personal install command appears here once you have access.
Usage
Import it, pass your props, and make it part of your product.
example.tsx
import { Leaf } from 'lucide-react';import { DonutBreakdownChart } from '@/components/component-kit/items/chart-donut-breakdown';
export function Example() { return ( <DonutBreakdownChart icon={Leaf} title="Generation by source" centerLabel="Total generation" format={(v) => `${v.toLocaleString()} GWh`} slices={[ { id: 'solar', label: 'Solar', value: 1240 }, { id: 'wind', label: 'Wind', value: 980 }, { id: 'hydro', label: 'Hydro', value: 610 }, ]} /> );}Props
| Prop | Type | Default | Description |
|---|---|---|---|
slices | DonutSlice[] | — | Slices with id, label, value and optional light/dark color. |
centerLabel | ReactNode | Total | Label under the centre figure. |
thickness | number | 0.36 | Ring thickness as a fraction of the radius. |
action | ReactNode | — | Header slot for a menu button. |