Component
Funnel Chart
A vertical conversion funnel: one bar per step, filled to its share of the first step, with the continue-rate and drop-off between each pair of steps. It renders an ordered list, so every figure is real text.
Basic
Steps with optional descriptions.
- VisitorsLanded on the site12,400100.0% of top25.0% continue−9,300 dropped
- Sign-upsCreated an account3,10025.0% of top38.1% continue−1,920 dropped
- TrialsStarted a free trial1,1809.5% of top35.6% continue−760 dropped
- Purchases4203.4% of top
Custom copy and formatting
Every label and number format is a prop, for localisation.
- VisitorsLanded on the site12,400100% of visitors25% moved on9,300 left
- Sign-upsCreated an account3,10025% of visitors38% moved on1,920 left
- TrialsStarted a free trial1,18010% of visitors36% moved on760 left
- Purchases4203% of visitors
Installation
$
pnpm add @refraction-ui/reactUsage
tsx
import { FunnelChart } from '@refraction-ui/react'
export function CheckoutFunnel() {
return (
<FunnelChart
aria-label="Checkout funnel"
steps={[
{ id: 'visit', label: 'Visitors', value: 12400 },
{ id: 'signup', label: 'Sign-ups', value: 3100 },
{ id: 'buy', label: 'Purchases', value: 420 },
]}
/>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
steps | { id: string; label: string; description?: string; value: number }[] | -- | The funnel steps, top first. |
formatValue | (value: number) => string | toLocaleString | Formats counts. |
formatPercent | (percent: number) => string | '25.0%' | Formats a 0–100 percent. |
minBarPercent | number | 6 | Smallest bar width in percent, so tiny steps stay visible. |
shareLabel | (share: string) => string | '… of top' | Copy for a step's share of the top step. |
conversionLabel | (percent: string) => string | '… continue' | Copy for the continue-rate between steps. |
droppedLabel | (count: string) => string | '−… dropped' | Copy for the count lost between steps. |
className | string | -- | Merged onto the root <ol>. |