# Cash Flow Waterfall block

> Treasury Waterfall Data Grid with Expandable Lines and Actuals, Plan, Variance Tabs

Cash-flow grid: expandable parent lines drill into child items, Actuals/Plan/Variance tabs, Calendar month-range picker, search, plan-match and variance tooltips. For treasury, FP&A, budget, and burn dashboards. ReUI DataGrid, Frame, Badge.

- Type: Pro block
- Category: [Expansion](https://web.dev.reui.io/blocks/data-grid/expansion.md)
- Page: https://web.dev.reui.io/blocks/data-grid/expansion/data-grid-expansion-2
- Docs (Base UI): https://web.dev.reui.io/docs/components/base/data-grid.md
- Docs (Radix UI): https://web.dev.reui.io/docs/components/radix/data-grid.md
- MCP: `get_block("data-grid-expansion-2")`
- Built with: Badge, Button, Button Group, Calendar, Card, Data Grid, Frame, Input Group, Popover, Select, Separator, Tabs, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

Month columns over a picked range where each parent line sums its children, with plan match rings and an Expand All toggle

## Agent notes

- `TREASURY_LINES` is sample data; each parent's `values` come from `sumSeries` over its `children`, so supply child values and keep the roll-up
- `FINANCE_MONTHS` is a fixed 5 month window built from `NOW`, and the Calendar disables dates outside it; generate it from your data range
- The New Transaction button in `TreasuryGridView` has no `onClick`, so connect it to your entry form

## When not to use

- Rows bucketed under collapsible headers by a shared field, not parents with child lines: use [Roadmap by Stage](https://web.dev.reui.io/blocks/data-grid/grouping/data-grid-grouping-1.md) (`get_block("data-grid-grouping-1")`)

## Third-party libraries

- TanStack Table v9: [API reference](https://tanstack.com/table/v9/docs/framework/react/reference/index), [docs](https://tanstack.com/table/v9/docs/framework/react/quick-start)
- date-fns v4: [docs](https://date-fns.org/v4.1.0/docs/Getting-Started)
- React DayPicker v9: [API reference](https://daypicker.dev/v9/api), [docs](https://daypicker.dev/v9/start)

## Install

```bash
npx shadcn@latest add @reui/data-grid-expansion-2
```

## About Expansion blocks

### When to use

- Parent records that open in place to show the child rows or detail cards they hold
- Rolled up totals, such as a cash or budget line, that drill down to the items behind them
- Task and approval queues where each item carries its own sub-tasks or checklist

### When not to use

- Rows bucketed by a shared field value, or a tree nested more than one level deep: use the [Grouping blocks](https://web.dev.reui.io/blocks/data-grid/grouping.md)
- A finished page of flat records where every row stands alone, with nothing nested: use the [Base blocks](https://web.dev.reui.io/blocks/data-grid/base.md)
- A table you assemble from the bare parts, where no row opens to reveal more: use [Data Grid](https://web.dev.reui.io/components/data-grid.md) (`get_component("data-grid")`)

### Agent notes

- Each page.tsx centers the view in a `min-h-svh` main capped at `max-w-7xl` beside an sr-only `h1`; keep only the view inside your app shell
- `pageSize` counts parent rows only, so open children always stay on their parent's page; page your API by parent and return children with it

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
