Xzero UI
Pro library

Funnel chartPro

A tapered conversion funnel with drop-off at every step, a device split that morphs the band, and dots that stream through it.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/funnel-chart
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/funnel-chart

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { FunnelChart } from "@/components/xzero/funnel-chart/funnel-chart";

const segments = [{ key: "mobile", label: "Mobile" }, { key: "desktop", label: "Desktop" }];
const stages = [
  { key: "visit", label: "Visited store", values: { mobile: 68420, desktop: 31580 } },
  { key: "cart", label: "Added to cart", values: { mobile: 9140, desktop: 7280 } },
  { key: "purchase", label: "Purchased", values: { mobile: 1540, desktop: 2050 } },
];

export function Checkout() {
  const [view, setView] = useState("total");
  return <FunnelChart stages={stages} segments={segments} view={view} label="Checkout funnel" unit="sessions" />;
}

API reference

FunnelChart

A conversion funnel drawn as one smooth tapered band: flat across each step and eased between them, with drop-off at every boundary. Segments can be isolated or split with a 2px gap, and every change morphs the band. Optional dots stream through it and the share that leaves at each step falls out.

PropTypeDefaultDescription
stages (required)FunnelStage[]–Ordered steps: { key, label, value? , values? }. Use value without segments, values keyed by segment with them.
segmentsFunnelSegment[]–Parts of every step, such as devices: { key, label }. Leave it out for one total per step.
label (required)string–What is counted. Names the chart, the summary, and the table.
unitstring""Noun after counts in the tooltip and table, such as "sessions".
view"total" | "split" | string"total""total" draws one band, "split" stacks every segment with a gap, and a segment key isolates it and rescales the band to fill the height.
flowbooleantrueDots that stream through the band. Each decides up front where it leaves, so the falling share matches the real drop-off.
orientation"auto" | "horizontal" | "vertical""auto"Auto turns the funnel vertical below 420px of container width, with steps listed down the side.
heightnumber200Band area thickness in pixels when horizontal.
formatValue(value: number) => string–Formats counts. Defaults to compact numbers in headings and full numbers in the tooltip.
activeIndexnumber | null–Controlled step in focus.
onActiveChange(index: number | null) => void–Called as the step in focus changes.
emptyLabelstring"No data"Message when the first step is zero.
refRef<HTMLElement>–Forwarded to the figure.
classNamestring–Extra class on the figure.

Keyboard interactions

KeysAction
TabFocuses the funnel and reads the first step.
ArrowRight / ArrowDownNext step.
ArrowLeft / ArrowUpPrevious step.
Home / EndFirst or last step.
EscapeClears the reading.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in advanced charts

Guidance for AI tools

Funnel chart: A tapered conversion funnel with drop-off at every step, a device split that morphs the band, and dots that stream through it. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components