Installation
pnpm dlx shadcn add @eased-pro/spend-breakdownnpx shadcn add @eased-pro/spend-breakdownyarn dlx shadcn add @eased-pro/spend-breakdownbunx --bun shadcn add @eased-pro/spend-breakdownInstalls from the @eased-pro registry and MCP server. · Already have Pro? Sign in.
Install the dependencies
pnpm add motion d3-shapenpm install motion d3-shapeyarn add motion d3-shapebun add motion d3-shapeAdd the Eased pieces it builds on
Copy each item’s files the same way, or install them with the CLI:
Add the files
- components/eased/spend-breakdown/spend-breakdown.tsx
Source is included with Eased Pro. Members download the files with the CLI command above, or through the MCP server.
Keep the folder layout
The files import each other by relative path (
../lib/motion), so keep each one at the path shown, undercomponents/eased/.
Props
| Prop | Type | Default | |
|---|---|---|---|
categories | SpendCategory[] | { id, label, amount, color? }, in a fixed order across periods so arcs morph in place. Colours default to chartColor(i + 1). | |
currency | string | "USD" | |
totalLabel | string | "Total spend" | Centre label at rest. |
hidden / defaultHidden / onHiddenChange | string[] | [] | Categories turned off (at least one stays on). |
locale | string | runtime |
Under 26rem the donut stacks above the legend. Legend rows are toggle buttons (aria-pressed); hovering or focusing one lifts its arc and dims the rest.
Motion signature: the donut sweeps in once on first view; a new period morphs every arc from its angle on screen on the smooth spring; the centre label swaps and its amount rolls to the active category; turning a category off flattens its arc while the rest close the gap. Reduced motion: no sweep, no morph.