Componentcharts0.88 KB gzipZero dependencies
Sankey Chart
Two-level flow diagram with bezier ribbons, value-based width, hover tooltips, and entrance animations.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add sankey-chartOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SankeyChart } from "@/components/ui/sankey-chart"; <SankeyChart nodes={nodes} flows={flows} />Source code
sankey-chart.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxsankey-chart.tsx200 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; /** * SankeyChart - two-level flow diagram with bezier ribbons */interface SankeyNode { id: string; label: string; side: "left" | "right";} interface SankeyFlow { from: string; to: string; value: number;Props
| Prop | Type | Description |
|---|---|---|
| nodes | { id: string; label: string; side: "left" | "right" }[] | Nodes positioned left or right. |
| flows | { from: string; to: string; value: number }[] | Flows connecting nodes with values. |