Donut Chart
FREEDonut or pie with animated slices; the hovered slice shows in the center.
Installation
Terminal
npx @bloxa/cli add donut-chart
# or: npx shadcn@latest add @bloxa/donut-chartPackages installed automatically: motion
Examples
Donut and pie
9,750
- Search4,820
- Direct2,310
- Social1,640
- Email980
API reference
Every component also accepts the props of the element it renders.
DonutChart
| Prop | Type | Default | Description |
|---|---|---|---|
| index / category | string | — | Slice name and value keys. |
| variant | "donut" | "pie" | "donut" | Donut or pie. |
| size / thickness | number | 180 / 22 | Diameter and ring thickness in px. |
| label | ReactNode | — | Center text; defaults to the total. |