Skip to content

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.

Also known as: monthly annual pricing toggle, pricing plans cards, pricing section with billing switch, subscription pricing cards

Pricing Cards with Billing Toggle live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 pricing section with three plan cards and a pill-shaped Monthly / Annual switch that updates every price, the crossed-out regular price and the "Billed …" line. Use it on SaaS landing pages, membership sites and product pricing pages where annual billing comes with a discount.

How it works

The root is section.pb-pricing on a soft lavender background with two radial gradients. The billing switch is a fieldset.pb-switch with two Bootstrap btn-check radio inputs (.pb-period, values monthly and annual) whose labels are styled as a segmented control; the checked label turns dark. The three plans are article.card.pb-card elements in a responsive row (one column on phones, two on tablets, three from lg). The middle card has .pb-card--featured, a violet gradient, the .pb-flag label and is lifted slightly on large screens.

Each card stores its prices on .pb-amount as data-monthly and data-annual (the per-month price on yearly billing). On DOMContentLoaded and on every change of a .pb-period input, the script formats the right value with Intl.NumberFormat, shows .pb-was with the monthly price only in annual mode, and writes "Billed $144 yearly" (annual price times 12) or "Billed monthly" into .pb-billed. The new price fades in with the pb-swap animation through .pb-amount--swap. Without JavaScript the annual prices in the markup are shown.

Customization

  • --pb-accent and --pb-accent-rgb in .pb-pricing: change the check icons, button hover color, focus rings and card borders.
  • --pb-featured-from and --pb-featured-to in .pb-pricing: recolor the gradient of the featured card.
  • --pb-card-radius in .pb-pricing: make the cards rounder or more square.
  • data-monthly and data-annual on each .pb-amount: set your prices; the old price and the yearly total are calculated from them.
  • data-pb-currency="USD" on .pb-pricing: show prices in EUR, GBP or any ISO currency code.
  • checked on #pb-monthly instead of #pb-annual: start with monthly prices.
  • The .pb-save text "Save 20%": keep it in line with the difference between your two prices.
  • Move .pb-card--featured and .pb-flag to another card to recommend a different plan.

Use cases

  • SaaS landing pages: three plan cards switch between monthly and annual prices with one click
  • Membership sites: the crossed-out regular price shows the discount for choosing annual billing
  • Product pricing pages: yearly totals and savings update automatically with the switch
  • Startup sites: a highlighted featured plan guides visitors to the plan you want them to pick

Accessibility

The switch is a real radio group inside a fieldset with a visually hidden legend ("Billing period"), so arrow keys move between options and screen readers announce the state. Focus is shown with a visible outline on the labels. When the period changes, the visually hidden .pb-status live region announces it; the first render stays silent. The regular price has a visually hidden "Regular price" prefix so it is not read as the current price. Each card is an article labelled by its plan name, and icons are aria-hidden. The price animation is disabled with prefers-reduced-motion: reduce.

Usage notes

Requires Bootstrap 5 and Bootstrap Icons. For several instances on one page, give each switch its own radio name and id values.

Pricing Cards with Billing Toggle at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, 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 Cards with Billing 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 5 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@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/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">
Pricing Cards with Billing Toggle – free Bootstrap 5 pricing table template
Pricing Cards with Billing Toggle · free Bootstrap 5 pricing table template

More Pricing Tables

Pricing Table with Feature Tooltips – free Bootstrap 5 pricing table template

Pricing Table with Feature Tooltips

Bootstrap 5 plan comparison table with a highlighted popular plan and info tooltips that explain every feature on hover or keyboard focus.

Pricing with Team Size Range – free Bootstrap 6 pricing table template

Pricing with Team Size Range

Bootstrap 6 per-seat pricing card with a Range slider for team size, volume tiers, a monthly/annual toggle and a live total price.

Dark Pricing Section – free Bootstrap 6 pricing table template

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 – free Bootstrap 6 pricing table template

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 – free Bootstrap 6 pricing table template

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 Table with Monthly Yearly Toggle – free Bootstrap 6 pricing table template

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.