Sankey Chart

A React SVG sankey diagram that lays nodes out in columns from the links, draws gradient ribbons, highlights a node's flows on hover or focus and includes a hidden data table.

src/registry/ui/sankey-chart.tsx/r/sankey-chart.json

Installation#

bash
npx shadcn@latest add @minidev/sankey-chart

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/sankey-chart.json

Usage#

tsx
import { SankeyChart } from "@/components/ui/sankey-chart"

export function Example() {
  return <SankeyChart />
}

API reference#

SankeyChart props
PropTypeDefault
linksSankeyLink[]SAMPLE_LINKS
nodesSankeyNodeInput[]SAMPLE_NODES
align"left" | "justify""left"
titlestring"Where signups come from"
captionstring"Last 30 days, visitors to paid plan"
heightnumber320
nodeWidthnumber10
nodePaddingnumber14
format(value: number) => stringdefaultFormat
unitstring"visitors"
classNamestring-
All chart components