Skip to content

Waterfall Chart for React

A React waterfall chart, or bridge chart, breaks a running total into its increases and decreases. Pass data as readonly WaterfallStep[]: the steps in order: { label, value }.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/waterfall-chart.json

Profit and loss

Use the arrow keys to read each step.

  • WaterfallChart
  • WaterfallTable
  • waterfallLegend
  • defaultWaterfallChartLabels
  • defaultWaterfallTableLabels
  • +3 more

Annual results, step by step

Switch the year to see every bar morph to its new place. Below 480px, or as soon as a step name wouldn't fit whole under its column, it turns into horizontal bars. Hover, tap or use the arrow keys for each step's change and running total.

Profit and loss

Financial year 2026 results

  • Increase
  • Decrease
  • Total

Files to copy

12 folders · 27 files · 4 packages
From theme/src/
  • components/charts/{waterfall-chart.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-tip.tsx, chart-utils.ts, heatmap.tsx}
  • components/charts/chart-parts/
  • components/charts/heatmap/
  • components/drawer/parts/sheet.tsx
  • components/kbd/
  • components/menu/
  • components/skeleton/
  • components/status-icons/
  • hooks/{use-controllable.ts, use-intersection.ts, use-latest.ts, use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/waterfall-chart.jsonRegistry item: waterfall-chart. The styles need the Tailwind v4 glass UI setup.
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".

Cash flow, horizontal

Horizontal at every width, for long step names. The running total dips below its start mid-month; the zero line firms up only when values cross it.

Cash flow

Net cash movement in October 2026 by step

  • Inflow
  • Outflow
  • Balance

WaterfallChart

PropTypeDefaultDescription
data (required)readonly WaterfallStep[]NoneThe steps in order: { label, value?, kind? }. Kinds are "start", "delta", "subtotal" and "total".
layout"horizontal" | "vertical" | "auto""auto""auto" draws columns, and switches to horizontal bars when the chart is narrow or a step name wouldn't fit whole.
increaseColorChartColor7The diverging pair: palette slots for increases and decreases (default blue / red). Totals are neutral.
decreaseColorChartColor8Sets the palette slot (1 to 8) of decreases.
heightnumber240Plot height (vertical layout). Horizontal grows with the number of steps.
format((n: number) => string)formatCompact in localeFormats values and ticks.
localestring"en"Locale of the default number format.
showValuesbooleantrueSigned value labels on the bars ("+1.2K", "−400"), so colour is never the only cue.
showConnectorsbooleantrueHairline steps joining each bar to the next at the running total.
emptyStateReactNodeNoneShown when there are no steps.
labelsPartial<WaterfallChartLabels>defaultWaterfallChartLabelsEvery other string, for translation: labels={{ increase: "…" }}; omitted keys keep the English of defaultWaterfallChartLabels. All 7 keys of WaterfallChartLabels are listed in the key table under the props table.
aria-label (required)stringNoneNames the chart for assistive tech (required).
classNamestringNoneAdds extra classes to the outer element.
WaterfallChartLabels keys and English defaults (7)
Pass any key in labels; the rest keep the defaults of defaultWaterfallChartLabels.
KeyEnglish default
increaseIncrease
decreaseDecrease
totalTotal
runningTotalRunning total
instructionsUse the arrow keys to read each step.
roleDescriptionwaterfall chart
hintTap or hover a bar for its change

WaterfallTable props and waterfallLegend

PropTypeDefaultDescription
data (required)readonly WaterfallStep[]NoneThe steps in order: { label, value?, kind? }. Kinds are "start", "delta", "subtotal" and "total".
format((n: number) => string)formatCompact in localeFormats values and ticks.
localestring"en"Locale of the default number format.
captionstringNoneHidden caption that names the table for screen readers.
headersPartial<{ step: string; change: string; runningTotal: string; }>NoneOverride the column headers: { step, change, runningTotal }.
labelsPartial<WaterfallTableLabels>defaultWaterfallTableLabelsStrings for the cells that have no value. Merged over defaultWaterfallTableLabels. Every other string, for translation: labels={{ notApplicable: "…" }}; omitted keys keep the English of defaultWaterfallTableLabels. Its only key is listed in the key table under the props table.
emptyStateReactNodeNoneShown when there are no steps.
waterfallLegend(labels?, colors?)LegendItem[]NoneReturns the increase / decrease / total legend items for ChartCard.
WaterfallTableLabels keys and English defaults (1)
Pass any key in labels; the rest keep the defaults of defaultWaterfallTableLabels.
KeyEnglish default
notApplicableNot applicable

Keyboard

KeysAction
TabFocus the chart. It is one tab stop; the arrow keys then read it.
Arrow keysMove between steps.
Home/EndJump to the first / last step.
EscapeClear the reading.

Accessibility

  • Keyboard and screen-reader users get a single focusable figure labelled by the chart title, with a short reading hint as its description; inside a ChartCard with a table view, aria-details links it to the table. Every value read is announced politely, once. Every change carries a signed label (+ or −) and bars grow in their own direction, so color is never the only signal.
  • WaterfallTable is the same data as a real table. Pass it to ChartCard's table prop and the Chart / Table tabs let anyone read every value without color or sight.
  • With reduced motion on, the bars start at their final values and a data change jumps straight to the new state.

All exports on this page

  • WaterfallChart — A running total broken into its steps: a start, increases and decreases floating from the previous level, subtotals and a total from zero.
  • WaterfallTable — Every step with its signed change and the running total after it.
  • defaultWaterfallChartLabels — The built-in English strings of WaterfallChart; spread it into your own labels and change what you need.
  • defaultWaterfallTableLabels — English defaults of WaterfallTableLabels.
  • waterfallLegend — Legend items for a waterfall's three kinds of bar (pass to ChartCard's legend).

When to use the waterfall chart

  • Use it as a profit and loss chart, from revenue through costs to net income, with increases and decreases floating from the previous level and a total drawn from zero.
  • It fits a monthly cash flow with long step names, set to horizontal layout, where the running total dips below its start mid-month and the zero line firms up.
  • It works for explaining a variance between two periods, such as budget to actual, with subtotals marking checkpoints along the way.
  • Skip it when steps are not additive or have no meaningful order; use BarChart for plain comparison, and FunnelChart when each stage is a subset of the one before.
  • Pair it with ChartCard, waterfallLegend for increase, decrease and total keys, and WaterfallTable to list each step's change and running total as text.

Frequently asked questions

48 charts pages in all: browse them on Charts.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .