Ballmac UI home

Flow Sankey

New

A dependency-free flow diagram: columns placed by the longest chain, crossings reduced, links as thick as their value, nodes as buttons that light up their flows, a detail line, and the same flows as a table for screen readers.

v1.0.0Updated Oct 24, 2026Ships with a test
What changed

Pricing · 4,100 in · 4,100 out

Flows, from one step to the next
FromToAmount
AdsHome page4,200
AdsPricing1,800
SearchHome page3,100
SearchDocs2,600
SocialHome page1,900
SocialDocs700
Home pageSigned up1,500
Home pagePricing2,300
Home pageLeft5,400
PricingSigned up1,900
PricingLeft2,200
DocsSigned up900
DocsLeft2,400

Installation

$ pnpm dlx shadcn@latest add @ballmac/flow-sankey

Usage

import { FlowSankey, layoutSankey } from "@/components/ballmac/flow-sankey"

The full example is in the Code tab above.

Examples

An agent run's outcomes

Select a step to follow its flows.

Flows, from one step to the next
FromToAmount
RunsNo approval needed812 runs
RunsAsked a person238 runs
No approval neededFinished741 runs
No approval neededFailed71 runs
Asked a personFinished160 runs
Asked a personDenied64 runs
Asked a personFailed14 runs

API reference

PropTypeDefault
nodes*SankeyNode[]—
links*SankeyLink[]—
format

Turns a value into text.

(value: number) => string(v) => v.toLocaleString("en-US")
selected

The selected node id. Controlled.

string | null—
defaultSelected

The selected node id for uncontrolled use.

string | nullnull
onSelectedChange

Called when a node is chosen, or null when it is cleared.

(id: string | null) => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabEnters the diagram once, on the first node (or the selected one)
ArrowDown / ArrowUpNext or previous node in the same column
ArrowRight / ArrowLeftThe nearest node in the next or previous column
Enter / SpaceSelects the node and shows its totals in a polite live region
Screen readersEach node reads 'Search: 12,400 in, 11,900 out'; every flow is also in a hidden table with From, To and Amount

Use with AI

nodes is [{ id, label, group? }]; links is [{ source, target, value }]. Columns, order and sizes are computed (layoutSankey is exported). format(value), selected / defaultSelected / onSelectedChange. Links with zero value, unknown ids or a node linking to itself are ignored. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Flow Sankey (@ballmac/flow-sankey) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing where traffic, money or users go step by step, with drop-off
  • Outcomes of agent runs: attempts, tool calls, approvals, results

Not for

  • A simple conversion funnel of one path; use funnel-1
  • Proportions with no steps; use treemap
  • A graph where cycles matter; use agent-graph

Registry JSON: https://ui.ballmac.com/r/flow-sankey.json

Credits

Free to use in personal and commercial projects.

npm
None

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.