Skip to content

Funnel Chart for React

A React funnel chart that shows conversion stage by stage, printing how many continued and how many dropped off at every step. Pass data as readonly FunnelStage[]: the stages in order.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/funnel-chart.json

Signup funnel

Use the up and down arrow keys to read each stage.

  • FunnelChart
  • FunnelTable
  • defaultFunnelChartLabels
  • defaultFunnelTableLabels
  • +2 more

Conversion, stage by stage

Centered bars read as a funnel; start-aligned bars are easier to compare by length. Switch the month to see the bars resize with a transform-only layout animation while the steps morph with them. Focus the chart and use the up and down arrow keys; on a phone the reading docks above the stages.

Signup funnel

October 2026, all channels

4.1%visit to paid
Use the up and down arrow keys to read each stage.

Files to copy

12 folders · 27 files · 4 packages
From theme/src/
  • components/charts/{funnel-chart.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-tip.tsx, chart-utils.ts, heatmap.tsx}
  • components/charts/chart-parts/
  • components/charts/heatmap/
  • components/drawer/parts/sheet.tsx
  • components/kbd/
  • components/menu/
  • components/skeleton/
  • components/status-icons/
  • hooks/{use-controllable.ts, use-intersection.ts, use-latest.ts, use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/funnel-chart.jsonRegistry item: funnel-chart. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/spinner/
  • components/toast/
  • hooks/use-direction.ts
  • lib/state-light.tsx
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/toast.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".

Checkout, clickable stages

Start-aligned, in another hue, with stage clicks (pointer, Enter or Space) wired to a handler. Without the drop-off lines it becomes a compact ranked view.

Checkout

Last 30 days

Use the up and down arrow keys to read each stage.

Patterns

Hatch fills tell the stages apart without colour (the counts are text already). They switch on by themselves above three stages; pass patterns to force them.

Use the up and down arrow keys to read each stage.

FunnelChart

PropTypeDefaultDescription
data (required)readonly FunnelStage[]NoneThe stages in order, e.g. [{ label: "Visited", value: 48200 }, ...]. Negative values count as 0.
align"center" | "start""center""center": a classic funnel, bars centred; "start": bars from a shared left edge (easier to compare).
colorChartColor1Hue: stages step from the full slot colour (first) to lighter (last), an ordinal ramp.
format((n: number) => string)formatCompact in localeFormats a stage count for the labels, tooltips and data table: takes the number, returns the text shown.
formatPercent((ratio: number) => string)percentages in localeFormats a ratio (0.412 → "41.2%").
localestring"en"Locale of the default number formats.
patternsbooleantrue when data.length > 3Tell stages apart without colour (hatch fills).
showDropOffbooleantrueShow the "continued / dropped off" line between stages.
onStageClick((stage: FunnelStage, index: number) => void)NoneCalled with the stage and its index when it is clicked, tapped, or activated with Enter or Space. Makes stages interactive.
emptyStateReactNodeNoneShown when there are no stages.
labelsPartial<FunnelChartLabels>defaultFunnelChartLabelsEvery other string, for translation: labels={{ continued: "…" }}; omitted keys keep the English of defaultFunnelChartLabels. All 7 keys of FunnelChartLabels are listed in the key table under the props table.
aria-label (required)stringNoneNames the chart for assistive tech (required).
classNamestringNoneAdds extra classes to the outer element.
FunnelChartLabels keys and English defaults (7)
Pass any key in labels; the rest keep the defaults of defaultFunnelChartLabels.
KeyEnglish default
continuedcontinued
droppedOffdropped off
ofFirstof first stage
ofPreviousof previous stage
instructionsUse the up and down arrow keys to read each stage.
roleDescriptionfunnel chart
hintTap or hover a stage for its conversion

FunnelTable

PropTypeDefaultDescription
data (required)readonly FunnelStage[]NoneThe stages in order, e.g. [{ label: "Visited", value: 48200 }, ...]. Negative values count as 0.
format((n: number) => string)formatCompact in localeFormats a stage count for the labels, tooltips and data table: takes the number, returns the text shown.
localestring"en"Locale of the default number formats.
formatPercent((ratio: number) => string)percentages in localeFormats a ratio (0.412 → "41.2%").
captionstringNoneHidden caption that names the table for screen readers.
headersPartial<{ stage: string; count: string; ofFirst: string; ofPrevious: string; dropped: string; }>NoneText of the table's column headers (stage, count, share of first, share of previous, dropped); pass only the ones you translate.
labelsPartial<FunnelTableLabels>defaultFunnelTableLabelsStrings for the cells that have no value. Merged over defaultFunnelTableLabels. Every other string, for translation: labels={{ notApplicable: "…" }}; omitted keys keep the English of defaultFunnelTableLabels. All 2 keys of FunnelTableLabels are listed in the key table under the props table.
emptyStateReactNodeNoneShown when there are no stages.
FunnelTableLabels keys and English defaults (2)
Pass any key in labels; the rest keep the defaults of defaultFunnelTableLabels.
KeyEnglish default
notApplicableNot applicable
noDataNo data

Keyboard

KeysAction
TabFocus the chart. It is one tab stop; the arrow keys then read it.
↓/→Next stage.
↑/←Previous stage.
Home/EndJump to the first / last stage.
Enter/SpaceActivate the stage being read, when onStageClick is set.
EscapeClear the reading.

Accessibility

  • The chart is one focusable figure: its aria-label is the chart title, a one-line hint describes how to read it, and in a ChartCard with a table view aria-details points at that table. Each move is announced politely, once. Counts and conversion are text, so color never carries the reading; each move announces the stage.
  • FunnelTable is the same data as a real table. Pass it to ChartCard's table prop and the Chart / Table tabs let anyone read every value without color or sight.
  • Under reduced motion nothing morphs: the stages render at their final widths and new data replaces the old at once.

All exports on this page

  • FunnelChart — Stages as horizontal bars with the conversion between each pair.
  • FunnelTable — Every stage with its count, conversion and drop-off.
  • defaultFunnelChartLabels — The built-in English strings of FunnelChart; spread it into your own labels and change what you need.
  • defaultFunnelTableLabels — English defaults of FunnelTableLabels.

When to use the funnel chart

  • Use it as a conversion funnel chart for a signup or checkout funnel: visited, signed up, activated, paid, with each stage showing its count and share of the first stage.
  • Keep showDropOff on (it is the default) to print how many continued and how many dropped between stages, so the biggest leak in an onboarding or sales pipeline stands out without hovering.
  • Use onStageClick to turn stages into drill-downs, for example opening the list of accounts lost between Trial and Paid in a side panel.
  • Skip it when the steps are not sequential or users can skip stages, because a Sankey chart shows branching paths, and a plain Bar chart handles independent categories.
  • Pair it with ChartCard and FunnelTable for a text twin, SegmentedControl to flip between weekly and monthly data, and Badge to flag the stage with the worst conversion.

Frequently asked questions

48 charts pages in all: browse them on Charts.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .