# Revenue Flow block

> Income statement Sankey chart with revenue, cost and profit flows and a quarter picker

Quarterly P&L as a Recharts Sankey: 3 revenue lines merge, then split into costs and profit down to net income. KPI deltas vs last quarter, node pinning, a revenue, cost or profit highlight, CSV export. ReUI Frame, shadcn Select. Earnings report.

- Type: Pro block
- Category: [Sankey Chart](https://reui.io/blocks/chart/sankey-chart.md)
- Page: https://reui.io/blocks/chart/sankey-chart/chart-48
- MCP: `get_block("chart-48")`
- Built with: Badge, Button, Chart, Dropdown Menu, Frame, Select, Toggle Group
- Installs with a ReUI Pro or Ultimate license; setup: https://reui.io/docs/license-setup

## Best for

A quarterly P&L traced from 3 revenue lines to net income, with margin moves against the prior quarter and a click to pin one lineage

## Agent notes

- Replace `STATEMENTS` and `COMPANY`; amounts are USD millions and `totalsOf` derives every subtotal, so enter line items only
- `STATEMENTS` runs oldest first and its first entry only seeds the deltas, because `PERIOD_OPTIONS` drops it from the quarter Select
- `downloadCsv` and `copySummary` confirm through sonner `toast`, so mount a Toaster for the feedback to show

## When not to use

- Trial signups by acquisition channel, leaking into a drop-off node at each step: use [Trial Journey](https://reui.io/blocks/chart/sankey-chart/chart-49.md) (`get_block("chart-49")`)
- Deals by lead source through sales stages, judged by their leakiest step: use [Pipeline Leakage](https://reui.io/blocks/chart/sankey-chart/chart-53.md) (`get_block("chart-53")`)

## Third-party libraries

- Recharts v3: [API reference](https://recharts.github.io/en-US/api/), [docs](https://recharts.github.io/en-US/guide/getting-started/)
- Motion v12: [API reference](https://motion.dev/docs/react-motion-component), [docs](https://motion.dev/docs/react) (the docs follow the latest Motion, with no React API break since v12)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/chart-48
```

## About Sankey Chart blocks

### When to use

- Money traced from its sources through each split, such as revenue lines down to net income
- Trial and sales funnels where every stage sheds volume and the size of each loss matters

### When not to use

- A share of one total split once, with no stage after the split: use the [Pie Chart blocks](https://reui.io/blocks/chart/pie-chart.md)
- Deploy or job runs where each row steps through fixed stages over time: use the [Status Tracker blocks](https://reui.io/blocks/chart/status-tracker.md)
- Headline totals and their deltas read as numbers, with no flow between them: use the [Stats blocks](https://reui.io/blocks/application/stats.md)

### Agent notes

- Each block exports a `Chart` with no props that reads constants from its data file, so live figures mean swapping those constants or adding props
- Series tones are set twice in value-faces, a color map behind `CHART_CONFIG` and a dot class map for the legend, so a recolor edits both
- Hover readouts render through the `formatter` of `ChartTooltipContent`, so a new field goes in the readout markup and not in the chart config

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