Skip to content

Pricing Table with Monthly Yearly Toggle

Bootstrap 6 three-tier pricing table with a monthly/yearly billing switch that updates every price and billing note, plus a save badge and a popular plan.

Also known as: pricing table with toggle, monthly yearly pricing, billing switch pricing, three tier pricing section

Pricing Table with Monthly Yearly Toggle live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A three-tier SaaS pricing table built with Bootstrap 6, with a billing switch that flips every plan between monthly and yearly prices. It uses the native Bootstrap 6 Switch, theme-based buttons and badges, and the new Chip for the "Popular" label. It fits pricing pages, landing pages and upgrade screens.

How it works

The root .pmy-root contains a centered header and a .grid.grid-cols-1.md:grid-cols-3 of three .card.pmy-card articles. The billing control is a Bootstrap 6 .switch.switch-lg.theme-accent wrapper around input.pmy-toggle with role="switch". The visible "Monthly" and "Yearly" words sit on each side, and a badge theme-success shows the yearly saving.

Each price is a .pmy-amount span with data-monthly and data-yearly values. Each billing line is a .pmy-note with the same two attributes. script.js listens to the switch's change event and also makes the two period words clickable. It then copies the matching data value into every amount and note, adds .pmy-is-yearly to the root (which bolds the active word and fades the save badge in monthly mode) and briefly adds .pmy-flip so changed numbers slide in. A visually hidden aria-live paragraph, .pmy-live, announces the new billing period. The markup already contains the yearly values, so the table is complete without JavaScript.

The middle card has .pmy-card--team: a 2px accent border, a soft tinted top, a solid btn-solid theme-accent button and a chip theme-accent active label.

Customization

  • data-monthly and data-yearly on each .pmy-amount and .pmy-note: set your own prices and billing text.
  • Remove checked from .pmy-toggle to load the table in monthly mode. Also put the monthly numbers in the markup so the no-JS state matches.
  • theme-accent on the switch, buttons and chip: swap for theme-primary, theme-success or another role to recolor the whole table.
  • --pmy-bg and --pmy-dot on .pmy-root: change the lavender background and its dotted pattern.
  • --pmy-featured on .pmy-root: sets the border and tint of the highlighted plan. Move .pmy-card--team to another card to feature it instead.
  • Change md:grid-cols-3 on .pmy-grid to md:grid-cols-2 for a two-plan layout.

Use cases

  • SaaS pricing pages: a billing switch flips every plan between monthly and yearly prices
  • Landing pages: a save badge highlights the discount for choosing yearly billing
  • Upgrade screens: three plans sit side by side with a Popular chip on one
  • Subscription products: billing notes change together with each price

Accessibility

The switch is a real checkbox with role="switch" and aria-label="Bill yearly", so it works with Space and announces its state. The decorative period words are aria-hidden because the switch label already covers them. Price changes are announced politely through .pmy-live. Each card is an article labelled by its plan heading, and icons are aria-hidden. Card lift and the number animation are disabled under prefers-reduced-motion.

Bootstrap 6 notes

Bootstrap 5's form-check form-switch becomes <div class="switch"><input type="checkbox" role="switch" switch></div>, and switch-lg sizes it. btn-primary / btn-outline-primary become btn-solid / btn-outline with a theme-* class, and badge bg-success becomes badge theme-success. row-cols-md-3 becomes the CSS-grid utility md:grid-cols-3. The "Popular" pill uses the new .chip component. Built on Bootstrap 6.0.0-alpha.1, so class names may still change. Icons come from Bootstrap Icons.

Pricing Table with Monthly Yearly Toggle 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
Pricing Tables
License
Free for personal and commercial use

Questions about this template

Can I use the Pricing Table with Monthly Yearly Toggle 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.

Pricing Table with Monthly Yearly Toggle – Bootstrap 6 pricing tables component screenshot
Pricing Table with Monthly Yearly Toggle · Bootstrap 6 Pricing Tables

More Pricing Tables

Pricing Cards with Billing Toggle – Bootstrap 5 pricing tables preview

Pricing Cards with Billing Toggle

Bootstrap 5 pricing cards with a Monthly / Annual segmented switch that updates prices, savings and yearly totals, plus a highlighted featured plan.

Dark Pricing Section – Bootstrap 6 pricing tables preview

Dark Pricing Section

Dark Bootstrap 6 pricing section with three glass cards, a gradient-bordered recommended plan, a currency Menu and an FAQ link that opens a Drawer with an accordion.

Pricing Comparison Table – Bootstrap 6 pricing tables preview

Pricing Comparison Table

Bootstrap 6 feature comparison table across four plans with check icons, a highlighted Pro column, tooltips, a sticky feature column and an Only differences filter.

Pricing Table with Highlighted Plan – Bootstrap 6 pricing tables preview

Pricing Table with Highlighted Plan

Bootstrap 6 pricing cards with a raised dark green Most popular plan, gold accents and a team-size Range slider that recalculates every plan's monthly total.

Pricing Plan Comparison Table – WordPress pricing tables preview

Pricing Plan Comparison Table

A pricing plan comparison table for the block editor that compares three plans across eight features in a striped table, with prices in the header and plan buttons below.

Three-Tier Pricing Table with Highlighted Plan – WordPress pricing tables preview

Three-Tier Pricing Table with Highlighted Plan

A three-tier pricing table for the block editor with Starter, Pro and Business plans, a highlighted dark Pro plan card, feature lists and full-width buttons.