Skip to content
Charts

Funnel Chart

Stage drop-off. Default and Motion variants.

Examples

Installation

Default is a ready-made wrapper from the registry. Motion is the composable engine at @cronus-ui/ui/charts (peer visx + motion).

bash
npx cronus-ui add funnel-chart
tsx
import { FunnelChart } from "@cronus-ui/ui";

Usage

tsx
import { FunnelChart } from "@cronus-ui/ui/charts";
<FunnelChart
data={stages}
color="var(--chart-1)"
layers={3}
showPercentage
showValues
showLabels
/>

Components

Motion API — compose these under the chart root. Default wrapper props are in Default API below.

FunnelChart

Stage drop-off with halo layers, hover, optional patterns, and a banded grid.

Skip FunnelChartProps props table
PropTypeDefaultDescription
data*
FunnelStage[]label, value, optional displayValue / color / gradient.
orientation
"horizontal" | "vertical""horizontal"Layout.
color
stringvar(--chart-1)Default segment color.
layers
number3Halo rings behind the innermost fill.
gap
number4Gap between segments in px.
edges
"curved" | "straight""curved"Segment edge style.
showPercentage
booleantrueShow conversion %.
showValues
booleantrueShow values.
hoveredIndex
number | nullControlled hover.
renderPattern
(id, color) => ReactNodevisx pattern per segment.
grid
boolean | GridConfigBanded background + gap lines.

Layers, edges, patterns

layers draws concentric halos. edges="straight" is a trapezoid. renderPattern fills the innermost ring with a visx pattern while halos stay solid.

tsx
<FunnelChart
data={stages}
layers={3}
edges="curved"
labelLayout="grouped"
renderPattern={(id, color) => (
<PatternLines id={id} height={6} width={6} stroke={color} strokeWidth={1} orientation={["diagonal"]} />
)}
/>

Data format

ts
type FunnelStage = {
label: string;
value: number;
displayValue?: string;
color?: string;
gradient?: { offset: string | number; color: string }[];
};
const stages: FunnelStage[] = [
{ label: "Visit", value: 10000, displayValue: "10k" },
{ label: "Signup", value: 4200, displayValue: "4.2k" },
{ label: "Paid", value: 980, displayValue: "980" },
];

Theming

Motion charts read `--chart-*` aliases that map onto Cronus semantic tokens (`--cronus-chart-1`…`--cronus-chart-5`, `--cronus-border`, `--cronus-fg`, surfaces). Override the aliases or the tokens — never palette scales (`bg-zinc-900`). Default wrappers use `ChartConfig` with `var(--cronus-chart-*)` / `var(--cronus-primary)`.

Full token reference: Theming.

Dependencies

Default needs the recharts peer. Motion needs visx (and sometimes d3) as optional peers — install only what this chart uses.

bash
bun add recharts
bash
bun add motion @visx/pattern

Default API

Generated from the Default wrapper's exported types. Motion subcomponents are documented above.

FunnelChartProps

Extends HTMLAttributes<HTMLDivElement>

Skip FunnelChartProps props table
PropTypeDefaultDescription
data*
FunnelChartItem[]