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
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add sankey-chart

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { SankeyChart } from "@/components/ui/sankey-chart"; <SankeyChart nodes={nodes} flows={flows} />

Source code

sankey-chart.tsx + 1 helper

Zero 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

PropTypeDescription
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.