FunnelChart
Stage-to-stage conversion as a centered funnel.
Import
import { FunnelChart } from '@matix/charts/funnel-chart';Usage
Stages render top to bottom in the order you pass them — the funnel never re-sorts, so a classic signup funnel reads Visits → Signups → Activated → Paid.
Segments default to solid; choose light or gradient when the funnel needs a lower-emphasis or dimensional treatment.
| Category | Value |
|---|---|
| Visits: | 12,400. |
| Signups: | 4,900. |
| Activated: | 2,300. |
| Paid: | 940. |
Without labels
Turn off the label gutter for a denser plot, and opt into the legend since the labels are no longer naming each stage.
| Category | Value |
|---|---|
| Visits: | 12,400. |
| Signups: | 4,900. |
| Activated: | 2,300. |
| Paid: | 940. |
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
data | readonly ChartDatum[] | — | Stages, rendered top to bottom in the given order; non-positive values are skipped |
fill | ChartFill | solid | Segment treatment: solid, light, or gradient |
width | number | — | Controlled layout width; enables deterministic SSR |
initialWidth | number | — | SSR width hint replaced by client measurement |
height | number | 280 | SVG height in px — width is measured from the container |
showLabels | boolean | true | Stage labels + values in a right gutter |
showTooltip | boolean | true | Show the hover tooltip (value and conversion share) |
showLegend | boolean | false | Show the legend — opt-in, since labels already name the stages |
animate | boolean | true | Segments grow in from the center line, staggered top to bottom |
formatters | ChartFormatters | — | Format stage labels and values across labels, tooltips, legends, and data |
label | string | — | Accessible name; defaults to the joined stage labels |
labels | ChartLabels | — | Screen-reader text of the data table and the legend, for translation |
showLabel | boolean | false | Render label as a visible title above the plot |
sx | StyleXStyles | — | StyleX style override |
ChartDatum
| Field | Type | Description |
|---|---|---|
id | string | Stable data identity |
label | string | Stage label, falls back to id |
colorIndex | number | Palette slot 0–7; defaults to input order |
value | number | Stage magnitude; must be finite and positive to render |
Accessibility
labelprovides the concise image name.descriptionadds a richer summary througharia-describedby; consumer-owned text or a visible table can be linked with thearia-describedbyprop.- Up to 20 rendered stages receive a visually hidden native data table.
accessibleDatareplaces that table with custom React content; passnullto suppress it.labelstranslates the table text and the legend name. - Segment marks remain
aria-hidden; the chart is one image target and the table carries stage values. - The pointer tooltip is supplemental; the table carries values for assistive technology.
- The opt-in legend pairs every palette swatch with a text label; it does not claim a second visual encoding beyond color.
Server rendering
Pass width for deterministic server-rendered SVG. Use initialWidth for responsive hydration from a server estimate. Without either prop, the wrapper reserves height before client measurement.