Quire UI
Charts10

Waterfall

How an amount got from one figure to another, like MRR. Totals are worked out for you, every change says its share of the start, and the period before shows as outlines.

MRR movements in October
StepChangeRunning total
MRR Oct 1MRR Oct 1: $142.1K, $136.8K before$142.1K
NewNew: +$12.4K, +8.7% of start, $154.5K after, +$10.9K before$154.5K
ExpansionExpansion: +$5.3K, +3.7% of start, $159.8K after, +$6.1K before$159.8K
ReactivationReactivation: +$900, +0.6% of start, $160.7K after, +$600 before$160.7K
ContractionContraction: −$2.2K, −1.5% of start, $158.5K after, −$1.8K before$158.5K
ChurnChurn: −$6.8K, −4.8% of start, $151.7K after, −$4.9K before$151.7K
MRR Oct 31MRR Oct 31: $151.7K, $147.7K before$151.7K

Point at a bar, or arrow to it, to read it. Click one, or press Enter, to choose it.

Installation

npx shadcn@latest add @quireui-pro/waterfall

Part of Pro. Add the Pro registry with your token once, as shown in Installation, and the CLI brings in the free parts it builds on as well.

Usage

<Waterfall
  label="MRR movements in October"
  format={{ style: "currency", currency: "USD", notation: "compact" }}
  steps={[
    { label: "MRR Oct 1", kind: "start", value: 142100 },
    { label: "New", value: 12400 },
    { label: "Churn", value: -6800 },
    { label: "MRR Oct 31", kind: "total" },
  ]}
/>

A start sets the opening amount, each change adds or takes away, and a total shows the running amount at that point; you never type a total in, so it can never disagree with the steps. Put a total in the middle for a subtotal, like gross profit before the costs below it.

Increases are green, decreases red and totals a neutral grey, and every bar's label carries its sign, so the colour never says it alone. A dashed line runs from each bar's end to where the next one starts. Point at a bar, or arrow to it, and the line under the chart reads it in full: "Churn: −$6.8K, −4.8% of start, $151.7K after, −$4.9K before".

The scale

MRR moves a few percent a month, so on a scale from zero every change would be a sliver. When all the amounts sit far from zero, the scale zooms in on where the changes happen, and the start and total bars, cut short, carry a break mark near their foot so nobody reads their length. When the amounts come near zero, like a profit that turns into a loss, the scale starts at zero. zero sets it either way.

Against the period before

Give a step its previous value and an outline behind the bar shows what it was: here churn rose from $4.9K to $6.8K while expansion slipped, which the outlines show before anyone reads a number.

Below zero

A running amount can go below zero, like an operating loss. A line marks zero, and bars hang below it.

Profit and loss in Q3
StepChangeRunning total
RevenueRevenue: $48K$48K
Cost of salesCost of sales: −$21K, −44% of start, $27K after$27K
Gross profitGross profit: $27K$27K
SalariesSalaries: −$24K, −50% of start, $3K after$3K
MarketingMarketing: −$9K, −19% of start, −$6K after−$6K
ToolsTools: −$2K, −4.2% of start, −$8K after−$8K
Operating resultOperating result: −$8K−$8K

Many small changes

fold gathers changes smaller than that share of the start into one Other bar, placed before the next total, so a bridge of many small movements stays readable. Reading Other lists what it holds.

MRR movements by plan change
StepChangeRunning total
MRR Oct 1MRR Oct 1: $142.1K$142.1K
NewNew: +$12.4K, +8.7% of start, $154.5K after$154.5K
ExpansionExpansion: +$5.3K, +3.7% of start, $159.8K after$159.8K
ChurnChurn: −$6.8K, −4.8% of start, $153K after$153K
OtherOther: +$460, +0.3% of start, $153.5K after, includes Seat add-ons, Annual switch, Storage add-on, Discounts, Downgrades$153.5K
MRR Oct 31MRR Oct 31: $153.5K$153.5K

Narrow

By default a waterfall stands up when there is room and lies along rows, names on the left, when its space is narrower than 576 pixels; orientation fixes either.

MRR movements in October
StepChangeRunning total
MRR Oct 1MRR Oct 1: $142.1K, $136.8K before$142.1K
NewNew: +$12.4K, +8.7% of start, $154.5K after, +$10.9K before$154.5K
ExpansionExpansion: +$5.3K, +3.7% of start, $159.8K after, +$6.1K before$159.8K
ReactivationReactivation: +$900, +0.6% of start, $160.7K after, +$600 before$160.7K
ContractionContraction: −$2.2K, −1.5% of start, $158.5K after, −$1.8K before$158.5K
ChurnChurn: −$6.8K, −4.8% of start, $151.7K after, −$4.9K before$151.7K
MRR Oct 31MRR Oct 31: $151.7K, $147.7K before$151.7K

Choosing a step

onPick is called with a step's label when its bar is clicked or chosen with Enter, like to list the accounts that churned. active and onActiveChange share the step being read with anything beside it.

Loading

Accessibility

The bars are a slider over the steps: screen readers hear the waterfall's name, then each step as you move, with its change, its share of the start, the running amount after it and the period before. A table of every step is read with it.

KeyAction
← / →, ↑ / ↓Previous or next step
Home / EndFirst or last step
EnterWith onPick: chooses the step
EscLeaves the step

Motion

The bars arrive once, growing from the baseline a few milliseconds apart, when the waterfall first scrolls into view, and glide to new numbers when they arrive; try the month switch at the top. The bar being read stays clear while the rest ease back. From the keyboard nothing waits, with reduced motion only the fades remain, and animate={false} turns the arrival and the gliding off.

Waterfall or something else?

  • An amount over time, rather than what moved it: a Chart.
  • How many make it through a sequence of steps: a Funnel.

API reference

Waterfall

How an amount got from one figure to another, like MRR: a start, each change up or down, and the total. Totals are worked out, every bar says its share of the start, and the period before shows as outlines behind.

Prop

Type

Also takes every <figure> attribute. Style it with [data-slot="waterfall"].

On this page