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.jsonSignup funnel
FunnelChartFunnelTabledefaultFunnelChartLabelsdefaultFunnelTableLabels- +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
import { ChartCard } from "@/components/sheenui/charts/chart-parts/chart-card";
import { FunnelTable, FunnelChart, type FunnelStage } from "@/components/sheenui/charts/funnel-chart";
import { formatPercent } from "@/components/sheenui/charts/heatmap/kit";
// Package build (after the first npm release, or a packed tarball): import { ChartCard, formatPercent, FunnelTable, FunnelChart, type FunnelStage } from "@sheenui/theme";
const stages: FunnelStage[] = [
{ label: "Visited site", value: 48210 },
{ label: "Viewed pricing", value: 21904 },
{ label: "Started trial", value: 8412 },
{ label: "Activated", value: 5108 },
{ label: "Subscribed", value: 1964 },
];
const rate = (stages[stages.length - 1]?.value ?? 0) / (stages[0]?.value || 1);
export function Example() {
return (
<ChartCard
title="Signup funnel"
aside={<span className="text-2xl font-semibold">{formatPercent(rate)}</span>}
table={<FunnelTable data={stages} />}
>
<FunnelChart data={stages} align="center" aria-label="Signup funnel, October" />
</ChartCard>
);
}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.tsxcomponents/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.tslib/{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.tslib/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
import { FunnelChart, type FunnelStage } from "@/components/sheenui/charts/funnel-chart";
import { useToast } from "@/components/sheenui/toast/toast";
// Package build (after the first npm release, or a packed tarball): import { FunnelChart, useToast, type FunnelStage } from "@sheenui/theme";
// This example also uses toast: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/toast.json
const checkout: FunnelStage[] = [
{ label: "Cart", value: 9240 },
{ label: "Shipping details", value: 6875 },
{ label: "Payment", value: 5012 },
{ label: "Order placed", value: 4386 },
];
export function Example() {
const toast = useToast();
return (
<FunnelChart
data={checkout}
align="start"
color={7}
onStageClick={(stage) => toast.info(stage.label)}
aria-label="Checkout funnel"
/>
);
}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.
import { FunnelChart } from "@/components/sheenui/charts/funnel-chart";
// Package build (after the first npm release, or a packed tarball): import { FunnelChart } from "@sheenui/theme";
const stages = [
{ label: "Visited", value: 12000 },
{ label: "Signed up", value: 3400 },
{ label: "Subscribed", value: 820 },
];
export function Example() {
return <FunnelChart patterns data={stages} aria-label="Conversion from visit to subscription, hatched" />;
}FunnelChart
FunnelChartLabels keys and English defaults (7)
FunnelTable
FunnelTableLabels keys and English defaults (2)
Keyboard
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
Related pages
48 charts pages in all: browse them on Charts.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .