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
| From | To | Value |
|---|---|---|
| Salary | Income | $4.2K |
| Freelance | Income | $1.3K |
| Dividends | Income | $500 |
| Income | Home | $1.9K |
| Income | Food | $900 |
| Income | Travel | $700 |
| Income | Savings | $2.5K |
Soft ribbons that show how amounts flow from one stage to the next.
npx shadcn@latest add ikislay/pixel-ui/sankey-chartimport { SankeyChart } from "@/components/ui/sankey-chart"const nodes = [{ id: "salary", label: "Salary" },{ id: "freelance", label: "Freelance" },{ id: "income", label: "Income" },{ id: "rent", label: "Rent" },{ id: "savings", label: "Savings" },]const links = [{ source: "salary", target: "income", value: 4200 },{ source: "freelance", target: "income", value: 1300 },{ source: "income", target: "rent", value: 1900 },{ source: "income", target: "savings", value: 3600 },
1// Loading…
Options you can pass to customize this component.
nodes*{ id: string; label?: string; color?: string }[]The stages. Each one lands in the column of its longest path from a source, top to bottom in the order given.
links*{ source: string; target: string; value: number }[]The flows between stages, by id. Links to unknown ids, to themselves or with no value are skipped.
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.
heightnumberHeight in pixels. The width fills the parent, with room for labels on both sides.
nodeWidthnumberWidth of each stage's rounded bar in pixels.
classNamestringMerged onto the root element.