A funnel chart built with Bootstrap 6 that shows how visitors move through five stages: visitors, sign-ups, trials, paid and renewed. Each stage is a narrowing shape with its user count, the step conversion from the previous stage and the share of all visitors. Use it as a sales funnel chart, conversion funnel or marketing funnel visualization on SaaS dashboards.
How it works
The root .fnl-root holds a card with a header (title, computed 30-day date range and the overall conversion KPI), a toolbar with a channel switch and a legend, the .fnl-chart area and the .fnl-detail panel.
script.js reads the STAGES and SEGMENTS arrays at the top of the file. It builds one .fnl-row button per stage inside the ol.fnl-list. Each row has an inline SVG .fnl-poly trapezoid: its top edge is the stage width and its bottom edge the next stage width, so the rows join into one funnel. Colours are mixed from COLOR_FROM (deep blue) to COLOR_TO (cyan).
Clicking a stage marks it with aria-pressed="true" and fills the detail panel: description, users, change against the previous 30 days, a progress bar for the step conversion, share of visitors, users dropped and median time to reach the stage. Hovering or keyboard focus shows the .fnl-tip tooltip. The .fnl-segments radios switch channels and redraw everything, including the hidden table.
Customization
STAGESinscript.js: rename stages, change the Bootstrap Icons class, the description or themediantime.SEGMENTSinscript.js: replacecountsandprevwith your numbers, or add a channel together with a new radio label in.fnl-segments.COLOR_FROMandCOLOR_TOinscript.js: a different gradient, for example violet to pink.MIN_WIDTHinscript.js: how wide the narrowest shape may get (in % of the chart width).DEFAULT_STAGEinscript.js: the stage shown in the detail panel on load.--fnl-row-hon.fnl-root: taller or flatter funnel shapes.--fnl-bg,--fnl-activeand--fnl-lineinstyle.css: page background, selected row tint and divider colour.
Use cases
- SaaS dashboards: visitor to trial to paid conversion at a glance
- E-commerce analytics: product view, cart, checkout and purchase steps
- Marketing reports: compare organic and paid channel funnels
Accessibility
Every stage is a native button with a full aria-label (users, step conversion, share of visitors) and aria-pressed for the selected stage. Arrow keys, Home and End move between stages, Escape hides the tooltip. The detail panel is a polite live region, so a new selection is read out. A visually hidden table repeats all numbers for screen readers. The channel switch uses native radio inputs, and focus rings stay visible.
Bootstrap 6 notes
The channel switch uses Bootstrap 6 toggle buttons (label.btn-check.btn-outline.theme-primary with the input inside the label) instead of the Bootstrap 5 btn-check + btn-outline-primary pair. Trend and conversion labels use badge badge-subtle theme-*, and the card uses --bs-card-* variables. Built on 6.0.0-alpha.1; alpha APIs can still change.