Donut chart

Core

A donut whose arcs morph between datasets, with the active value rolling into the center.

pnpm dlx shadcn@latest add https://wui.alann.works/r/donut-chart.json

Items by type. Total 191. Core, 145, 76%. Pro Components, 25, 13%. Pro Blocks, 21, 11%.

Items by type
SegmentValueShare
Core14576%
Pro Components2513%
Pro Blocks2111%

API Reference

PropTypeDefault
data*DonutChartDatum[]required
label*stringrequired
unitstring—
formatValue(value: number) => string—
totalLabelstring—
sizenumber—
thicknessnumber—
groupBelownumber—
maxSegmentsnumber—
otherLabelstring—
activeKeystring | null—
defaultActiveKeystring | null—
onActiveChange(key: string | null) => void—
hiddenKeysstring[]—
defaultHiddenKeysstring[]—
onHiddenKeysChange(keys: string[]) => void—
legendAction"toggle" | "select"—
legendboolean—
emptyLabelstring—
refRef<HTMLElement>—
classNamestring—
Categories
data
Dependencies
motion