Funnel Chart
boldkit/funnel-chartFreeComponent
Funnel chart for conversion flows and pipeline stages with neubrutalism styling
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/funnel-chart.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'3import { FunnelChart as RechartsFC, Funnel, LabelList, Tooltip, ResponsiveContainer } from 'recharts'4import { ChartEmpty } from './chart'56export interface FunnelChartData {7 name: string8 value: number9 fill?: string10}1112export interface FunnelChartProps extends React.HTMLAttributes<HTMLDivElement> {13 data: FunnelChartData[]14 showLabels?: boolean15 showTooltip?: boolean16 animated?: boolean17 height?: number18 /** Accessible label for screen readers (default: "Funnel chart") */19 ariaLabel?: string20 emptyState?: React.ReactNode21}2223const NEUBRUTALISM_COLORS = [24 'hsl(var(--primary))',25 'hsl(var(--secondary))',26 'hsl(var(--accent))',27 'hsl(var(--success))',28 'hsl(var(--info))',29 'hsl(var(--warning))',30]3132const FunnelChart = React.forwardRef<HTMLDivElement, FunnelChartProps>(33 (34 {35 data,36 showLabels = true,37 showTooltip = true,38 animated = true,39 height = 300,40 ariaLabel = 'Funnel chart',41 emptyState,42 className,43 ...props44 },45 ref46 ) => {47 if (!data || data.length === 0) {48 return <ChartEmpty ref={ref} message={emptyState} className={className} {...props} />49 }5051 const coloredData = data.map((d, i) => ({52 ...d,53 fill: d.fill || NEUBRUTALISM_COLORS[i % NEUBRUTALISM_COLORS.length],54 }))5556 return (57 <div58 ref={ref}59 role="img"60 aria-label={ariaLabel}61 className={cn('w-full', className)}62 style={{ height }}63 {...props}64 >65 <ResponsiveContainer width="100%" height="100%">66 <RechartsFC>67 <Funnel68 dataKey="value"69 data={coloredData}70 isAnimationActive={animated}71 animationDuration={400}72 stroke="hsl(var(--foreground))"73 strokeWidth={3}74 >75 {showLabels && (76 <LabelList77 position="right"78 fill="hsl(var(--foreground))"79 stroke="none"80 dataKey="name"81 style={{ fontFamily: "'DM Mono', monospace", fontSize: 11, fontWeight: 700 }}82 />83 )}84 </Funnel>85 {showTooltip && (86 <Tooltip87 contentStyle={{88 border: '3px solid hsl(var(--foreground))',89 borderRadius: 0,90 boxShadow: '4px 4px 0px hsl(var(--foreground))',91// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps |
