FunnelChart

How many make it through each step of a flow, with the conversion from the previous step or from the start.

Status: beta. Category: Data display.

import { FunnelChart } from '@glyphui/ui/chart'

Exports: FunnelChart.

Notes

  • Rows are stages in order. Bar widths are relative to the first stage.
  • One measure, one color: later stages are tints of the same hue.

FunnelChart props

PropTypeDefaultDescription
category (required)stringField naming each stage, e.g. "stage".
data (required)readonly T[]One row per stage, in order.
title (required)string
value (required)stringField holding how many reached the stage.
classNamestring
colorChartColorValueDefault chart-1. Later stages are lighter tints of it.
conversion"none" | "previous" | "first"Under each value: share of the first stage or of the previous one. Default previous.
descriptionReactNode
emptyReactNodeShown when there is no data. Defaults to a short "No data" message.
errorunknownShows an error message in place of the plot, with a retry button when onRetry is set.
hideTitleboolean
loadingbooleanShows a skeleton in place of the plot.
onRetry(() => unknown)
valueFormatter((value: number) => string)

Example: Signup funnel

Step-to-step conversion.

import { FunnelChart } from '@glyphui/ui/chart'

const stages = [
  { stage: 'Visited pricing', people: 18420 },
  { stage: 'Started signup', people: 6210 },
  { stage: 'Verified email', people: 4870 },
  { stage: 'Created invoice', people: 2310 },
  { stage: 'Paid', people: 940 },
]

export default function Example() {
  return (
    <FunnelChart
      className="w-full"
      title="Signup to paid"
      description="Last 30 days"
      data={stages}
      category="stage"
      value="people"
    />
  )
}

Example: Share of the first step

conversion="first" measures every step against the top of the funnel.

import { FunnelChart } from '@glyphui/ui/chart'

const steps = [
  { step: 'Opened checkout', sessions: 3200 },
  { step: 'Entered card', sessions: 2140 },
  { step: 'Confirmed', sessions: 1890 },
]

export default function Example() {
  return (
    <FunnelChart
      className="w-full"
      title="Checkout completion"
      data={steps}
      category="step"
      value="sessions"
      conversion="first"
      color="chart-2"
    />
  )
}

Live page: https://glyphui.xyz/components/funnel-chart