Skip to content

Components

WaterfallChart

Net revenue

Use arrow keys to explore steps, or Home and End to jump.

Component reference

Properties

Use WaterfallChart

Signed changes and checkpoints along a running total.

Example import style
waterfall-chart.tsxTSX
"use client";

import { FloodRoot, WaterfallChart } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <WaterfallChart label="Net revenue (USD)" steps={[
        {id:"gross", label:"Gross", value:32000, kind:"total"},
        {id:"refunds", label:"Refunds", value:-4500},
        {id:"fees", label:"Fees", value:-2500},
        {id:"net", label:"Net", value:25000, kind:"total"}
      ]} />
    </FloodRoot>
  );
}

Design notes

  • A change adds its signed value to the running total. A total is an absolute checkpoint that replaces the running total.
  • Use the same domain for charts you want to compare. It must contain zero and every intermediate total. Use formatValue to add units.
  • Hover, tap or use the keyboard to inspect exact changes and running totals. Decreases use a dashed outline.

API reference

PropValuesDefault
labelstringRequired
stepsreadonly WaterfallChartStep[]Required
domainreadonly [number, number]—
formatValue(value: number) => string—
changeLabelstring—
totalLabelstring—
emptyLabelstring—
navigationLabelstring—
Native HTML propsOmit<HTMLAttributes<HTMLDivElement>, "children" | "role" | "aria-label">Forwarded
View TypeScript source