Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
| Category | Spent | Budget |
|---|---|---|
| Food | $640 | $600 |
| Food, Groceries | $380 | |
| Food, Dining | $190 | |
| Food, Coffee | $70 | |
| Rent | $1,400 | |
| Transport | $260 | |
| Transport, Transit | $120 | |
| Transport, Rideshare | $90 | |
| Transport, Fuel | $50 | |
| Fun | $310 | $250 |
| Fun, Concerts | $160 | |
| Fun, Games | $90 | |
| Fun, Books | $60 | |
| Bills | $230 |
A ring of thick tiles showing where the money went, where each category opens into a ring of its own parts.
npx shadcn@latest add ikislay/pixel-ui/spending-ringimport { SpendingRing } from "@/components/ui/spending-ring"const data = [{label: "Food",value: 640,budget: 600,children: [{ label: "Groceries", value: 380 },{ label: "Dining", value: 190 },{ label: "Coffee", value: 70 },],},{ label: "Rent", value: 1400 },{ label: "Transport", value: 220 },
1// Loading…
Options you can pass to customize this component.
data*{ label: string; value: number; budget?: number; color?: string; children?: { label: string; value: number; budget?: number; color?: string }[] }[]One tile per category, clockwise from the top. A category with children opens into them; parts without a color take shades of their category.
label*stringNames the chart for screen readers and captions its data table.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
thicknessnumberWidth of the ring in chart units, out of a 200 unit square.
totalLabelstringThe caption above the total in the center.
classNamestringMerged onto the root element.