Ballmac UI home

Waterfall Chart

New

A waterfall or bridge chart from a start to an end: floating bars for increases and decreases with a + or − sign as well as colour, totals on the baseline, connectors, real HTML labels and a table of the numbers for screen readers.

v1.0.0Updated Oct 24, 2026Ships with a test
What changed
Monthly recurring revenue, September to October
Monthly recurring revenue, September to October
StepChangeTotal after
SeptemberTotal$82.4k
New customers+$9.6k, increase$92.0k
Upgrades+$4.1k, increase$96.1k
Downgrades−$2.3k, decrease$93.8k
Cancelled−$5.2k, decrease$88.6k
OctoberTotal$88.6k

Ends at $88.6k.

Installation

$ pnpm dlx shadcn@latest add @ballmac/waterfall-chart

Usage

import { WaterfallChart, buildBars } from "@/components/ballmac/waterfall-chart"

The full example is in the Code tab above.

Examples

Crossing zero

Cash position over the quarter
Cash position over the quarter
StepChangeTotal after
Opening cashTotal$120k
Sales+$310k, increase$430k
Payroll−$240k, decrease$190k
Suppliers−$210k, decrease−$20k
Tax−$60k, decrease−$80k
Loan drawn+$50k, increase−$30k
Closing cashTotal−$30k

Ends at −$30k.

API reference

PropTypeDefault
steps*WaterfallStep[]—
format

Turns a value into text.

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

Height of the plot in pixels.

number260
title

A heading read by assistive technology and shown above the chart.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readersThe bars are decoration; a table lists each step with its change (+ or − and increase or decrease) and the total after it
SignsIncreases and decreases are written with + and − on the bars, so colour is never the only signal

Use with AI

steps is [{ id, label, value, kind?: 'change' | 'total' }]. A change floats from where the last step ended (positive is an increase, negative a decrease); a total sits on the baseline and resets the running total. format(value), height, title. Exports buildBars(steps). Server-rendered, no client code. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Waterfall Chart (@ballmac/waterfall-chart) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Explaining how a number moved from one value to another: revenue, headcount, cost
  • A variance or bridge between two periods

Not for

  • Showing a trend; use chart-line
  • Parts of a whole; use treemap or chart-pie
  • Steps with drop-off between stages; use flow-sankey

Registry JSON: https://ui.ballmac.com/r/waterfall-chart.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.