DonutChart #

Renders a donut chart using SVG stroke segments and an optional legend.

Props #

PropTypeRequiredDescription
data{ label: string, value: number, colorClass?: string }[]YesSegment data and optional Tailwind text color class.
sizenumberNoSVG width/height. Default: 180.
strokeWidthnumberNoDonut thickness. Default: 22.
showLegendbooleanNoShows legend next to chart. Default: true.
classNamestringNoOptional wrapper class names.

Live example #

Docs58%
API24%
Ops18%

Code #

mdx
<DonutChart
data={[
{ label: 'Published', value: 64 },
{ label: 'Draft', value: 21 },
{ label: 'Archived', value: 15 },
]}
/>