UI

Funnel chart

Tapered conversion band with step-to-step drop-off, spring-morphed segment views, and optional streaming flow dots.

import { FunnelChart } from '@uthereal/ui/funnel-chart'

Funnel chart playground

Checkout funnel

Checkout funnel, all. Visited store 100,000 sessions, Viewed product 50,760 sessions, Added to cart 16,420 sessions, Started checkout 7,310 sessions, Purchased 3,590 sessions. 3.6% reach the last step.

Checkout funnel
StepMobileDesktopShown totalKept from previousOf first step
Visited store68,420 sessions31,580 sessions100,000 sessions100%100%
Viewed product31,200 sessions19,560 sessions50,760 sessions51%51%
Added to cart9,140 sessions7,280 sessions16,420 sessions32%16%
Started checkout3,420 sessions3,890 sessions7,310 sessions45%7.3%
Purchased1,540 sessions2,050 sessions3,590 sessions49%3.6%
Loading interactive preview…

Overview

A funnel chart displays conversion through an ordered sequence of steps as one smooth tapered band. The band stays flat across each stage and eases between neighboring steps, showing compact counts and share of start above each stage and drop-off percentages with down-arrow glyphs at every boundary. Passing segments lets the host switch view between a single combined band ("total"), stacked segment layers separated by a 2 px gap ("split"), or an isolated segment key rescaled to fill the band height. Optional flow dots stream through the band and peel off at each boundary in proportion to the actual drop-off rate. Pointing at or focusing a stage glides a highlight column, pours full-strength color through that stage, and tracks a clamped tooltip. A native data table lists every stage, segment breakdown, step retention, and cumulative retention.

Use a funnel chart for linear conversion sequences such as checkout, signup, onboarding, or sales pipelines. When users can branch, skip stages, or recombine across paths, use Sankey flow. For unordered category comparisons, use a bar chart. For conversion rates tracked across dates, use a line chart.

Usage

import { useState } from 'react'
import { FunnelChart } from '@uthereal/ui/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: 'checkout',
    label: 'Started checkout',
    values: { mobile: 3420, desktop: 3890 },
  },
  {
    key: 'purchase',
    label: 'Purchased',
    values: { mobile: 1540, desktop: 2050 },
  },
]

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

Keep stage and segment key values stable across updates so view switches and new periods morph band layers in place instead of snapping. Pass view and onViewChange to drive the funnel from an external segmented control or filter bar, and pass activeIndex and onActiveChange to synchronize stage inspection with sibling summaries.

Examples

Split segment comparison

Pass segments and set defaultView="split" to stack segments with a 2 px gap, tint each layer with its categorical series hue, and list every segment's full count inside the stage tooltip.

Checkout funnel by device

Checkout funnel by device, by segment. Visited store 100,000 sessions, Added to cart 18,600 sessions, Started checkout 8,780 sessions, Purchased 4,560 sessions. 4.6% reach the last step.

Checkout funnel by device
StepMobileDesktopTabletShown totalKept from previousOf first step
Visited store62,000 sessions31,000 sessions7,000 sessions100,000 sessions100%100%
Added to cart9,400 sessions7,800 sessions1,400 sessions18,600 sessions19%19%
Started checkout3,800 sessions4,300 sessions680 sessions8,780 sessions47%8.8%
Purchased1,750 sessions2,420 sessions390 sessions4,560 sessions52%4.6%

Vertical pipeline without flow dots

Set orientation="vertical" and flow={false} for narrow containers or dense dashboards where steps read top to bottom beside the band. Combine valueFormat with tableToggle to format currency amounts and expose the data table on demand.

Enterprise sales pipeline

Enterprise sales pipeline, all. Qualified $1,840,000, Discovery $1,120,000, Proposal sent $640,000, Closed won $295,000. 16% reach the last step.

Enterprise sales pipeline
StepShown totalKept from previousOf first step
Qualified$1,840,000100%100%
Discovery$1,120,00061%61%
Proposal sent$640,00057%35%
Closed won$295,00046%16%

Behavior

Mode or widthLayout behavior
view="total"Draws one combined band tinted with --ui-series-1
view="split"Stacks every segment with a 2 px gap using --ui-series-1 through --ui-series-8
view="<segment>"Isolates that segment key, collapses other layers to zero, and rescales the band to full height
Width >= 420 pxHorizontal band with stage headings above, drop-off percentages below, and tooltip beside the stage
Width < 420 pxorientation="auto" turns vertical with stage headings down the side and drop-off marks on boundaries

Stage headings show compact numbers (100K, 9.1K) that preserve decimal places during rolling transitions so widths do not jitter. Tooltips and the data table show full formatted values. Touch presses and drags read stages continuously without blocking vertical page scroll. When the first stage count is zero, the plot displays emptyLabel ("No data").

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
labelstringDefault: "Conversion funnel"Names the chart for assistive technology and captions the data table when title is omitted.
titlestring—Optional visible figure heading above the funnel. Omit it to render without a heading while keeping label for assistive technology.
descriptionstring—One or two sentences on what the chart shows, below the title; omit it when the title says enough.
stagesFunnelStage[]Default: [{"key":"visit","label":"Visited store","value":100000},{"key":"product","label":"Viewed product","value":50760},{"key":"cart","label":"Added to cart","value":16420},{"key":"checkout","label":"Started checkout","value":7310},{"key":"purchase","label":"Purchased","value":3590}]Ordered conversion steps (2–12, unique keys). Pass value on each stage without segments, or values keyed by segment key when segments are supplied.
segmentsFunnelSegment[]—Optional breakdown applied to every stage (1–8, unique keys), such as devices, plans, or acquisition channels. Omit for a single total band.
unitstringDefault: ""Noun appended after counts in tooltips, announcements, and the data table, such as "sessions" or "users".
valueFormatNumberFormat—Intl number format for counts. Omit it for compact stage headings and full grouped numbers in tooltips and the data table.
defaultViewstringDefault: "total"Initial band view when uncontrolled: "total" draws one combined band, "split" stacks segments with a 2 px gap, and a segment key isolates and rescales that segment. Later edits do not reset a mounted instance.
flowbooleanDefault: trueDraw tiny dots streaming through the band that peel off at each stage proportionally to drop-off. Automatically paused off-screen, in hidden tabs, and under reduced motion.
orientationauto | horizontal | verticalDefault: "auto"Layout axis: "auto" renders horizontally at 420 px and wider, switching to vertical below 420 px with stage names down the side.
heightintegerDefault: 200Thickness of the horizontal band area in pixels (120–520). Ignored in vertical orientation.
emptyLabelstringDefault: "No data"Shown over the plot when the first stage count is zero.
tableTogglebooleanDefault: falseShow a button that reveals the data table. The table is always available to assistive technology.
tableLabelstringDefault: "Data table"Name of the data table button.
localestring—BCP 47 locale for numbers and dates. Omit it to inherit the application locale (en-US by default).
recipestudio | softDefault: "studio"Visual treatment. Both recipes use the same interaction behavior.
themeFunnelChartTheme—Color mode, accent, and semantic tokens including the chart series palette (series1–series8 tint segments in split and isolated views). See Theming.
motionnone | subtle | expressiveDefault: "subtle"Draw-in, band morph, rolling count, and flow-dot animation preset. System reduced-motion preferences take precedence.
motionOptionsFunnelChartMotionOptions—draw (band expanding from its centerline at 30% in view; 800 ms zero-bounce spring by default) and morph (view and dataset transitions; morph spring by default): a tween with duration (ms) or a spring.
dirltr | rtl—Reading direction of stage order, headings, drop-off badges, tooltips, and the table. Omit to inherit the page direction.

React integration

PropPurpose
viewControlled view ("total", "split", or a declared segment key)
onViewChangeFires with the next view string when updated, in both modes
activeIndexControlled zero-based stage index in focus, or null for none
onActiveChangeFires with the focused stage index or null as focus moves
formatValueCustom formatter (value: number) => string overriding valueFormat everywhere
presetApplication defaults, overridden by explicit instance props
tokensCSS variables applied after the typed theme
refRef forwarded to the root <figure>
className, styleApplied to the root <figure>
Native attributesid, data-*, and remaining <figure> attributes forwarded to the root

Keyboard & accessibility

KeyInteraction
TabFocus the funnel plot (reading the first stage), then optional table button
ArrowRight, ArrowDownMove to the next stage (ArrowLeft, ArrowDown in horizontal dir="rtl")
ArrowLeft, ArrowUpMove to the previous stage (ArrowRight, ArrowUp in horizontal dir="rtl")
Home, EndJump to the first or last stage
EscapeClear the active stage highlight and tooltip

The chart renders a <figure> named by title (or visually hidden label when title is omitted) and linked via aria-details to a native data table listing Step, each segment column when segmented, Shown total, Kept from previous, and Of first step. SVG bands, canvas dots, stage headings, and boundary drop-offs are hidden from assistive technology.

The plot forms a single focusable group (aria-roledescription="funnel chart"). Moving across stages updates a polite role="status" live region with the stage label, formatted count and unit, share kept from the previous step, and share of the first step. Drop-offs always pair an arrow glyph with a number rather than relying on color alone. Horizontal band progression, highlight coordinates, drop-off badges, and tooltips mirror cleanly in dir="rtl". Under forced-colors: active, system colors (Canvas, CanvasText, Highlight, GrayText) replace tinted fills and shadows.

Motion and theming

When 30% of the figure enters the viewport, the band expands from its centerline on an 800 ms zero-bounce spring (motionOptions.draw); server-rendered markup is already final. Switching view or updating stage values morphs every band layer and the 2 px split gap in place on a morph spring (motionOptions.morph), while counts and percentages roll smoothly on a zero-bounce spring. Pointer moves glide the highlight column, focus clip, and tooltip on a spring, whereas arrow keys snap them immediately.

When flow is enabled, dots stream across a DPR-scaled canvas and peel off at drop-off boundaries in proportion to real stage conversion. The canvas loop pauses automatically when the chart scrolls out of view or the browser tab is hidden. Both motion="none" and prefers-reduced-motion: reduce disable flow dots, snap morphs and numbers immediately, and remove CSS transitions.

theme accepts a mode, an accent, and semantic tokens across the core, control, and chart token groups (series1–series8 tint segments, with seriesOther as fallback). An application-wide UtherealProvider supplies defaults.

Composition

In an agent composition, FunnelChart is a leaf with no actions. The active view is host state stored at /components/instance-<id>/view, initialized from defaultView (default "total"). onActiveChange is a transient UI event bound to activeIndex. The host updates stages and segments through composition updates. See Building with agents.

{
  "type": "FunnelChart",
  "props": {
    "label": "Checkout funnel",
    "unit": "sessions",
    "segments": [
      { "key": "mobile", "label": "Mobile" },
      { "key": "desktop", "label": "Desktop" }
    ],
    "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 }
      }
    ]
  },
  "children": []
}

On this page