# Funnel chart

Steps of a process with how many reach each one and the conversion between them.

- Family: charts
- Import: `import { FunnelChart } from "@senvenli/react/charts";`
- Page: https://design.senvenli.com/docs/components/funnel-chart
- JSON: https://design.senvenli.com/docs/components/funnel-chart.json

## Example: Checkout funnel

Each step with its count and the conversion from the step before.

```tsx
import { FunnelChart } from "@senvenli/react/charts";

const STEPS = [
  { name: "Visited the store", value: 24800 },
  { name: "Viewed a product", value: 13150 },
  { name: "Added to cart", value: 4620 },
  { name: "Started checkout", value: 2310 },
  { name: "Placed an order", value: 1525 },
];
const count = new Intl.NumberFormat("en");

export default function Example() {
  return <FunnelChart title="Checkout funnel" period="March 2026" steps={STEPS} valueFormatter={count.format} />;
}
```

## Examples

### Counts only

Without the conversions, when the absolute numbers are the point.

```tsx
import { FunnelChart } from "@senvenli/react/charts";

const STEPS = [
  { name: "Trials started", value: 860 },
  { name: "Invited a teammate", value: 512 },
  { name: "Connected a data source", value: 298 },
  { name: "Upgraded to a paid plan", value: 121 },
];

export default function Example() {
  return <FunnelChart title="Trial to paid" period="Q1 2026" steps={STEPS} showStepConversion={false} showTotalConversion={false} />;
}
```

## Guidelines

### When to use it

- Where people drop out of a flow.

### Use something else when

- [bar-list](https://design.senvenli.com/docs/components/bar-list.md): The steps are independent categories, not a sequence people drop out of.
- [stepper](https://design.senvenli.com/docs/components/stepper.md): The steps are a flow to complete, not counts to compare.

## Accessibility

Built in:

- A "Show as table" button shows the same data as a table, which screen readers get by default.

You provide:

- A title that says what the figure is.

## API reference

### FunnelChart

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| title | `string` |  | no | What the chart shows, over it; leave it out when a card or a heading already says so. |
| aria-label | `string` |  | no | Names the chart when it has no visible `title` (a card's heading already says what it shows). |
| period | `string` |  | no |  |
| isLoading | `boolean` |  | no |  |
| emptyState | `React.ReactNode` |  | no | Shown instead of the plot when there is no data: an `EmptyState size="small"` or text; "No data" by default. |
| steps | `readonly FunnelStep[]` |  | yes | Truly ordered steps, each a subset of the one before. |
| valueFormatter | `ChartValueFormatter` | `plain` | no |  |
| showStepConversion | `boolean` | `true` | no | The conversion from the previous step beside each count. On by default. |
| showTotalConversion | `boolean` | `true` | no | The first-to-last conversion in the subtitle. On by default. |

### Tokens it reads

`--ds-background-brand-subtle`, `--ds-background-neutral`, `--ds-background-neutral-pressed`, `--ds-background-selected-hovered`, `--ds-background-selected-pressed`, `--ds-border`, `--ds-border-bold`, `--ds-border-focused`, `--ds-chart-1`, `--ds-chart-2`, `--ds-chart-3`, `--ds-chart-4`, `--ds-chart-5`, `--ds-chart-neutral`, `--ds-icon-danger`, `--ds-icon-success`, `--ds-icon-warning`, `--ds-link`, `--ds-radius-medium`, `--ds-radius-small`, `--ds-radius-xsmall`, `--ds-shadow-overlay`, `--ds-space-050`, `--ds-space-075`, `--ds-space-100`, `--ds-space-150`, `--ds-space-200`, `--ds-space-300`, `--ds-space-400`, `--ds-surface-overlay`, `--ds-surface-raised`, `--ds-text`, `--ds-text-danger`, `--ds-text-subtle`, `--ds-text-subtlest`, `--ds-text-success`

## Related

- [bar-chart](https://design.senvenli.com/docs/components/bar-chart.md)
