Examples

Sign-up funnel

Preview
Sign-up funnelFunnel of 4 stages from 12,000 Visited to 940 Subscribed (7.8% overall).
Use the arrow keys to move between data points, Home and End to jump to the first and last.
Example.tsx
import { FunnelChart } from '@reactloom/charts';

const stages = [
  { stage: 'Visited', people: 12000 },
  { stage: 'Started sign-up', people: 4200 },
  { stage: 'Verified email', people: 3100 },
  { stage: 'Subscribed', people: 940 },
];

export default function Example() {
  return <FunnelChart title="Sign-up funnel" data={stages} label="stage" value="people" />;
}

Hiring pipeline

Preview
Hiring pipelineMost candidates leave at screening.
Use the arrow keys to move between data points, Home and End to jump to the first and last.
Hiring pipeline (data)
CategoryHiring pipelineOf previousOf first
Applied640100%100%
Screened18028.1%28.1%
Interviewed4826.7%7.5%
Offered918.8%1.4%
Hired777.8%1.1%
Example.tsx
import { FunnelChart } from '@reactloom/charts';

const pipeline = [
  { step: 'Applied', n: 640 },
  { step: 'Screened', n: 180 },
  { step: 'Interviewed', n: 48 },
  { step: 'Offered', n: 9 },
  { step: 'Hired', n: 7 },
];

export default function Example() {
  return <FunnelChart title="Hiring pipeline" description="Most candidates leave at screening." data={pipeline} label="step" value="n" table="visible" />;
}

API reference

FunnelChart props
PropTypeDefault
datarequired
Row[]—
labelrequired
key or accessor—
valuerequired
key or accessor—
titlerequired
Names the figure.
string—
description
The takeaway; a factual summary is generated when omitted.
ReactNode—
table
The data table alternative.
'toggle' | 'visible' | 'none''toggle'
height · valueFormat · formatValue · messages
As on the other charts.
—

Customization

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-active]present when on

Theme tokens it reads

--pl-color-fg-default --pl-color-fg-muted

Accessibility

  • The chart is a figure named by its title and described by a summary; the drawing is hidden from assistive technology.
  • The plot is one tab stop: arrow keys move between items and each is announced; the data table gives every value.
Keyboard interactions
KeyAction
TabFocus the plot
← → ↑ ↓Move between items
Home / EndFirst / last item
EscapeClear the highlight

Usage guidelines

Do

  • Order stages as people move through them.

Don’t

  • Don't use a funnel for unrelated categories.