Klar

Charts / React chart kit primitives / Part-to-whole

Donut

Segments of a ring with gaps and a centre label; here MRR by plan.

React component Donut, data through props. How a total splits into its pieces. Tags: donut, pie, ring, share, composition, mrr.

Install

npm i klar-charts

import 'klar-charts/styles.css'
import { ThemeScope, Donut } from 'klar-charts'

# or copy the source:
npx shadcn@latest add https://klar.run/r/kit-donut.json

Usage

<Donut size={176} thickness={20} gap={0.05} segments={plans.map((p) => ({ value: p.mrr, color: planColor[p.key], label: p.label }))}>…</Donut>

Related donut charts