Budget allocationFree
Where does the budget go?
npx shadcn@latest add https://beautifulcharts.dev/r/budget-allocation.jsonEngine: ·
Code
"use client";
import { BudgetAllocationBlock } from "@/components/beautiful-charts/blocks/instrument/budget-allocation";
// The stats and copy recompute from your rows. Leave data out to see the sample.
export function Dashboard() {
return <BudgetAllocationBlock />;
}
Props
data
SankeyData
Your rows. Missing values are
nulland stay gaps; with no rows every stat shows a dash. Leave it out to see the sample.stats
ChartStat[] | false
Replace the computed stats with your own, or hide them with
false.footer
ReactNode | false
Replace the footer line, or hide it with
false.
| Prop | Type | Description |
|---|---|---|
| data | SankeyData | Your rows. Missing values are null and stay gaps; with no rows every stat shows a dash. Leave it out to see the sample. |
| stats | ChartStat[] | false | Replace the computed stats with your own, or hide them with false. |
| footer | ReactNode | false | Replace the footer line, or hide it with false. |
Every sankey chart prop works too, so you can restyle it without touching the source.
Accessibility, keyboard and motion
- Pointer
- Hover a node or link to highlight its whole path and show the flow; click pins it.
- Keyboard
- Tab lands once on the plot. Left and Right move between points (the first press goes to the latest), Up and Down change series, Home and End jump to the ends, Enter or Space pins, Escape clears.
- Screen readers
- Every move is announced as a sentence, not coordinates. "Show data table" opens the numbers as a real table, and missing values stay empty, never zero.
- Motion
- Bars grow from the baseline, staggered in data order, then the labels fade in. The headline number rolls in. With reduced motion everything appears settled at once, and nothing depends on the motion to be read.