Skip to content
mdxcn is now part of Shadcn Labs. details

waterfall

GraphWaterfall

A running total drawn as floating bars. The first row is the starting value, the last is the result, and the signed values in between move it up or down.

use it
Good for a running total as floating bars.
instead
Parts of a whole is Stack.

margin

[ MARGIN ]
  • Revenue48
  • Refunds−6
  • Hosting−4
  • Profit38
Revenue 48, Refunds −6, Hosting −4, Profit 38
<GraphWaterfall title="MARGIN" palette="duo">

- Revenue: 48
- Refunds: -6
- Hosting: -4
- Profit: 38

</GraphWaterfall>

install

command

headcount

[ TEAM ]
  • Start12
  • Hired+4
  • Left−2
  • Now14
Start 12, Hired +4, Left −2, Now 14
<GraphWaterfall title="TEAM">

- Start: 12
- Hired: 4
- Left: -2
- Now: 14

</GraphWaterfall>
[ PROPS ]
PropTypeDefaultDescription
titlestring—Caption drawn on the top edge of the frame.
itemsWaterfallItem[]—label, value, optional kind: start, in, out, or end. Kind is inferred if omitted. Optional when children are Markdown.
childrenMarkdown—- Refunds: -6
ticksnumber24Bar width in characters.
glyphs"shade" | "ascii" | "hash" | "bar" | string[]"shade"Character set. shade is ·░▒▓█. ascii is .- =#@. Pass a preset or your own characters.
palette"mono" | "duo" | "multi""mono"mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents.
cornerstring"+"Character at each corner of the frame.
frame"box" | "corners" | "rule" | "none""box"box draws the dashed border. corners keeps only the corner marks. rule draws dashed lines above and below. none drops the border and padding, and puts the title above the content.
classNamestring—Passed to the outer frame.