BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/EvilCharts/recharts-sankey-chart

recharts-sankey-chart

evilcharts/recharts-sankey-chart
FreeComponent

Sankey chart component for visualizing flow data with nodes and links

Install it

npx shadcn@latest add https://evilcharts.com/r/recharts-sankey-chart.json

Source

src/registry/charts/recharts-sankey-chart.tsxevilcharts.com/r/recharts-sankey-chart.json · first 6 KB
1"use client";
2
3import {
4 Sankey as RechartsSankey,
5 Layer,
6 type SankeyProps,
7 type SankeyNodeProps,
8 type SankeyLinkProps,
9 type SankeyData,
10 type SankeyNode as RechartsSankeyNode,
11} from "recharts";
12import {
13 Children,
14 createContext,
15 isValidElement,
16 use,
17 useCallback,
18 useId,
19 useMemo,
20 useState,
21 type FC,
22 type ReactElement,
23 type ReactNode,
24} from "react";
25import {
26 ChartTooltip,
27 ChartTooltipContent,
28 type TooltipRoundness,
29 type TooltipVariant,
30} from "@/registry/ui/recharts-tooltip";
31import {
32 type ChartConfig,
33 ChartContainer,
34 getColorsCount,
35 LoadingIndicator,
36} from "@/registry/ui/recharts-chart";
37import { ChartBackground, type BackgroundVariant } from "@/registry/ui/recharts-background";
38import { motion } from "motion/react";
39
40// Constants
41const LOADING_ANIMATION_DURATION = 2000; // full loading cycle duration in milliseconds
42const DEFAULT_NODE_WIDTH = 10;
43const DEFAULT_NODE_PADDING = 10;
44const DEFAULT_LINK_CURVATURE = 0.5;
45const DEFAULT_ITERATIONS = 32;
46
47type LinkVariant = "gradient" | "solid" | "source" | "target";
48type NodeLabelPosition = "inside" | "outside";
49
50// ─────────────────────────────────────────────────────────────────────────────
51// Shared context
52// ─────────────────────────────────────────────────────────────────────────────
53
54/**
55 * Shared state for every part of the chart. Lifted into <EvilSankeyChart /> so
56 * that <Node />, <Link />, and <Tooltip /> can read it without prop drilling.
57 * A sankey chart's data is rigid — the root passes `nodes`/`links` straight to
58 * Recharts — so the parts here configure how those nodes and links render.
59 */
60type SankeyChartContextValue = {
61 data: SankeyData; // the nodes + links rendered by the chart
62 config: ChartConfig; // colors + labels keyed by node name
63 chartId: string; // colon-free id scoping this chart's SVG defs
64 isLoading: boolean; // whether the chart shows its loading skeleton
65 selectedNode: string | null; // currently selected node name, or null when none
66 selectNode: (nodeName: string | null) => void; // sets the selected node
67};
68
69const SankeyChartContext = createContext<SankeyChartContextValue | null>(null);
70
71// … truncated

What it pulls in

npm packages

  • recharts
  • motion

Other registry items

  • @evilcharts/recharts-chart
  • @evilcharts/recharts-tooltip
  • @evilcharts/recharts-background

Files it writes

  • src/registry/charts/recharts-sankey-chart.tsx

Facts

Registry
EvilCharts
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

evilcharts.com legions-developer/evilcharts on GitHub Raw registry item This item as JSON

More from EvilCharts

All 271 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
echarts-area-chartecharts-area-chartEvilChartsComponentsFree2 deps
echarts-bar-chartecharts-bar-chartEvilChartsComponentsFree2 deps
echarts-brushecharts-brushEvilChartsComponentsFree1 dep
echarts-chartecharts-chartEvilChartsComponentsFree1 dep
echarts-composed-chartecharts-composed-chartEvilChartsComponentsFree2 deps
echarts-dotecharts-dotEvilChartsComponentsFree1 dep
echarts-legendecharts-legendEvilChartsComponentsFreeno deps
echarts-line-chartecharts-line-chartEvilChartsComponentsFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex