Chart Funnel

Charts how much of a population survives each stage of a sequence.

Configurations

Supported configurations for this component.

Configurations

2 examples
Neutral
Tone from data

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

FunnelStage

PropTypeDefaultDescription
idreqstring-Stable key for the stage.
labelreqstring-Stage name, shown under the band.
valuereqnumber-Absolute count at this stage. Must be <= the previous stage's value; a funnel where a stage grows is not a funnel.
tone'neutral'|'accent'|'warning'|'fault'|'context''neutral'How healthy this stage's reading is. Derive it from the data, never assign it to make the chart colourful.

FunnelChart

PropTypeDefaultDescription
stagesreqFunnelStage[]-Ordered stages, widest first. Two or more.
percentOf'first'|'previous''first'What each stage's percentage is measured against: the top of the funnel (overall conversion) or the stage before it (step conversion).
valueFormatter(value:number)=>string-Formats the count shown above each band. Defaults to a thousands-separated integer.
heightnumber200Height of the band area in px. Labels and values sit outside it.
emptyLabelstring'No data'Shown in place of the chart when `stages` is empty.
onStageSelect(stage:FunnelStage, index:number)=>void-Called when a stage is clicked or activated by keyboard.
classNamestring-Additional CSS classes applied to the root element.
styleReact.CSSProperties-Inline styles applied to the root element.

More Andromeda Pro components