Back to dashboards
ComponentChartFree

Sankey Diagram React component

A Sankey diagram of how things flow between stages: columns of nodes sized by volume, gradient ribbons whose thickness follows each flow, a layout that untangles crossings, hover highlighting of a node's paths and a tooltip with both shares.

About the Sankey Diagram component

Sankey Diagram shows how a quantity flows through stages: visitors from traffic sources to pages to outcomes, budget from departments to projects, energy from inputs to uses. Each ribbon's thickness is the size of that flow, coloured from where it comes from to where it goes.

The layout arranges nodes to keep ribbons from crossing. Hover or tap a ribbon to see its value and share at both ends, or a node to light up every path through it.

When to use it

Use it for user journeys and traffic attribution, budget and cost allocation, conversion paths that branch, supply chains, and any 'from → to' data with a few stages.

It needs flows that are acyclic (no loops back to an earlier stage). For a single linear flow, a funnel chart is easier to read.

Installation

Add the Sankey Diagram component to your project with the shadcn CLI. It lands in components/sankey-diagram.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/sankey-diagram

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install clsx tailwind-merge

More Chart components

Contribution Heatmap
Free
Treemap Chart
Free
Radial Bar Chart
Free
Waterfall Chart
Free
Streamgraph
Free
Funnel Chart
Free