StealThis .dev

Funnel Chart

A conversion funnel chart that visualizes step-by-step drop-off rates. Features animated trapezoid stages, percentage labels, drop-off callouts, and a horizontal comparison mode.

Open in Lab
vanilla-js svg react tailwind vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Features

  • Trapezoid stages — each stage narrows proportionally to value
  • Animated build — stages animate in sequentially on load
  • Drop-off labels — shows % lost between each stage
  • Hover detail — tooltip with stage name, absolute value, and conversion %
  • Color gradient — stages tinted progressively for visual flow

How it works

  1. Each stage’s width is computed as (value / maxValue) * containerWidth
  2. SVG <polygon> forms the trapezoid connecting stage top and bottom widths
  3. Stage labels and drop-off callouts are absolutely positioned <text> nodes
  4. Sequential animation-delay creates the staggered entrance effect