Skip to content

Funnel Chart

Sales funnel chart with five narrowing stages, user counts, step and overall conversion, a channel switch and a detail panel for the selected stage.

Also known as: sales funnel chart, conversion funnel, marketing funnel visualization, funnel diagram html, pipeline stages chart

Funnel Chart live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

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

  • STAGES in script.js: rename stages, change the Bootstrap Icons class, the description or the median time.
  • SEGMENTS in script.js: replace counts and prev with your numbers, or add a channel together with a new radio label in .fnl-segments.
  • COLOR_FROM and COLOR_TO in script.js: a different gradient, for example violet to pink.
  • MIN_WIDTH in script.js: how wide the narrowest shape may get (in % of the chart width).
  • DEFAULT_STAGE in script.js: the stage shown in the detail panel on load.
  • --fnl-row-h on .fnl-root: taller or flatter funnel shapes.
  • --fnl-bg, --fnl-active and --fnl-line in style.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.

Funnel Chart at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Charts
License
Free for personal and commercial use

Questions about this template

Can I use the Funnel Chart code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Funnel Chart – free Bootstrap 6 chart template
Funnel Chart · free Bootstrap 6 chart template

More Charts

Revenue Area Chart Card – free Tailwind CSS chart template

Revenue Area Chart Card

Revenue area chart card with total revenue, change versus the previous period, a revenue and costs SVG area chart, legend toggles and a keyboard-friendly tooltip.

Multi-Line Chart with Range Tabs – free Bootstrap 6 chart template

Multi-Line Chart with Range Tabs

SVG multi-line chart comparing organic, paid and email traffic, with 7 day, 30 day and 12 month tabs, legend toggles and a crosshair tooltip.

Sparkline KPI Row – free Pure CSS chart template

Sparkline KPI Row

Sparkline KPI row with four stat tiles, change badges and SVG sparklines that redraw when a 7d, 30d or 90d range is picked, with keyboard and touch tooltips.

SVG Line Chart with Hover Points – free Pure CSS chart template

SVG Line Chart with Hover Points

Smooth SVG line chart of daily website visitors with a gradient area fill, axis labels, and a crosshair tooltip that follows the pointer or the arrow keys.

Horizontal Bar Chart Ranking – free Bootstrap 6 chart template

Horizontal Bar Chart Ranking

Horizontal bar chart ranking the top 8 products by revenue, units or returns; a select re-sorts the bars and announces the new order.

Donut Chart with Legend – free Pure CSS chart template

Donut Chart with Legend

SVG donut chart of traffic sources with the total in the centre and an interactive legend that highlights each segment and shows its share, value and percent.