Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

Funnel

funnel

Visualizes stage-by-stage quantities as a proportional conversion funnel.

Usage

Basic usage (vertical)

One line per level, the center bar scales the width according to the value ratio, and the conversion rate logo is displayed by default between levels. per-stage tone Eat token.

Influx1240
Conversion 87.1%
Routing1080
Conversion 79.6%
Execute860
Conversion 83.7%
Complete720
tsx
<Funnel
  stages={[
    { id: "in", label: "Influx", value: 1240, tone: "brand" },
    { id: "route", label: "Routing", value: 1080, tone: "brand" },
    { id: "exec", label: "Execute", value: 860, tone: "warning" },
    { id: "done", label: "Complete", value: 720, tone: "success" },
  ]}
  ariaLabel="Funnel chart"
  conversionLabel="Conversion"
/>

Horizontal (horizontal)

One stage per column, scaling the height according to value, suitable for conversion funnels.

8600Visit
48.8%
4200Register
45.2%
1900Trial
33.7%
640Paid
tsx
<Funnel
  stages={[
    { id: "visit", label: "Access", value: 8600, tone: "brand" },
    { id: "signup", label: "Registration", value: 4200, tone: "brand" },
    { id: "trial", label: "Trial", value: 1900, tone: "warning" },
    { id: "pay", label: "Payment", value: 640, tone: "success" },
  ]}
  orientation="horizontal"
  ariaLabel="Funnel chart"
  conversionLabel="Conversion"
/>

Hide conversion rate logo

showConversion={false} Turn off the inter-stage conversion rate and only look at the volume.

Influx1240
Routing1080
Execute860
Complete720
tsx
<Funnel
  stages={stages}
  showConversion={false}
  ariaLabel="Funnel chart"
  conversionLabel="Conversion"
/>

Click to drill down

After passing onStageClick, the bar changes to a button. Click on the takeback stage to drill down.

Conversion 87.1%
Conversion 79.6%
Conversion 83.7%
tsx
<Funnel
  stages={stages}
  ariaLabel="Funnel chart"
  conversionLabel="Conversion"
  onStageClick={(s) => console.log(s.id)}
/>

When to use

Use Funnel for attrition in one linear process, such as visit to registration to payment. Use Sankey for branching directed flows, or [Table] for flat values.

Import

ts
import { Funnel, computeFunnel } from "@hulianui/ui"

Props

NameTypeDefaultDescription
stages*FunnelStage[]-{id, label, value, tone?} stages sized proportionally to value.
orientation"vertical" | "horizontal""vertical"Rows sized by width or columns sized by height.
shape"bar" | "trapezoid""bar"Stage bar shape: rounded bars ("bar") or connected trapezoids ("trapezoid", vertical only).
scale"proportional" | "uniform""proportional"Sizing mode: proportional to value ("proportional") or evenly tapered per step ("uniform").
minSizenumber-Minimum visual width/height ratio (0–1) so tiny stages keep readable labels; defaults to 0.36 in "uniform" mode.
conversionBase"previous" | "first""previous"Conversion denominator: adjacent previous stage ("previous") or the top first stage ("first").
showConversionbooleantrueShows conversion between adjacent stages.
ariaLabelstring"Funnel chart" with enUSAccessible chart name. Pass a localized value for other interfaces.
conversionLabelstring"Conversion" with enUSConversion badge prefix. Pass a localized value for other interfaces.
classNamestring-Root class name.

FunnelStage.tone is "neutral" | "brand" | "success" | "warning" | "danger", defaulting to brand.

Events

EventTypeDescription
onStageClick(stage) => voidCalled from a stage.

Slots

SlotTypeDescription
renderStage(stage, ctx: FunnelRenderCtx) => ReactNodeReplaces label and value (container inherits tone foreground automatically); context contains widthRatio, displayRatio, nullable conversion, index, tone, and fgClassName.

Example

tsx
<Funnel
  stages={[
    { id: "in", label: "Incoming", value: 1240, tone: "brand" },
    { id: "route", label: "Routed", value: 1080, tone: "brand" },
    { id: "exec", label: "Executed", value: 860, tone: "warning" },
    { id: "done", label: "Completed", value: 720, tone: "success" },
  ]}
  orientation="vertical"
  showConversion
  ariaLabel="Funnel chart"
  conversionLabel="Conversion"
  onStageClick={(s) => console.log(s.id)}
/>

Usage notes

  • Tone is a fixed semantic enum. Use renderStage for arbitrary colors.
  • computeFunnel returns null conversion for the first stage and never divides by zero; custom renderers must handle conversion == null.
  • Funnel has no client boundary, so server components and server-compatible renderStage functions remain supported. Localize ariaLabel and conversionLabel explicitly when needed.

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

Influx1240
Conversion 87.1%
Routing1080
Conversion 79.6%
Execute860
Conversion 83.7%
Complete720
<Funnel
  stages={[
    { id: "in", label: "Influx", value: 1240, tone: "brand" },
    { id: "route", label: "Routing", value: 1080, tone: "brand" },
    { id: "exec", label: "Execute", value: 860, tone: "warning" },
    { id: "done", label: "Complete", value: 720, tone: "success" },
  ]}
  orientation="vertical"
  showConversion={true}
  ariaLabel="Funnel chart"
  conversionLabel="Conversion"
  onStageClick={(s) => console.log(s.id)}
/>
PreviousSparklineData DisplayNextTreemap

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Slots
    • Example
    • Usage notes
    • Related
  • Playground