Skip to content

Checkout Shipping Method Selection

Bootstrap 5 checkout step with shipping method radio cards, live delivery dates, prices and an order summary that updates the total.

Also known as: shipping method selector, delivery options checkout, shipping options radio cards, checkout delivery step, choose shipping method

Checkout Shipping Method Selection live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 checkout step where shoppers pick a shipping method from large radio cards showing the price and the expected delivery date, next to an order summary that recalculates the total. Drop it between the address and payment steps of a checkout flow.

How it works

The root section.sm-root contains a small progress list (.sm-steps), a form.sm-form with the options and an aside.sm-summary. Bootstrap's grid puts the two columns side by side from the lg breakpoint and stacks them on smaller screens.

Each option is a .sm-option wrapper with a real radio input (.sm-option__input) followed by its label.sm-option__card. The input is visually hidden but stays focusable, and the CSS sibling selector .sm-option__input:checked + .sm-option__card gives the selected card a teal border, a tinted background and a filled icon. Each radio stores its cost in data-sm-price and its delivery window in data-sm-min and data-sm-max (business days).

On DOMContentLoaded the script replaces the static text in every [data-sm-date] element with real dates, skipping weekends with an addBusinessDays() helper and formatting them with Intl.DateTimeFormat, for example "Arrives Mon, Oct 19 - Tue, Oct 20". Options with data-sm-max="0", like store pickup, keep their own text. Without JavaScript the static ranges stay visible. A change listener on the radios calls update(), which writes the shipping cost, the method name, the tax, the total and the delivery estimate into .sm-shipping, .sm-summary__method, .sm-tax, .sm-total and .sm-eta. The .sm-continue button simulates saving and shows a confirmation in .sm-status.

Customization

  • data-sm-subtotal and data-sm-tax-rate on .sm-root: set the cart subtotal and the tax rate used for the total (0.08 is 8 percent).
  • data-sm-price on a radio: change the shipping cost; also update the visible .sm-option__price text.
  • data-sm-min and data-sm-max on a radio: change the delivery window; equal values show a single date.
  • --sm-accent and --sm-accent-soft on .sm-root in style.css: recolor the selected card, prices and the delivery banner.
  • --sm-radius on .sm-root: make the cards and summary rounder or square.
  • The .sm-tag badge inside a card name: move it to highlight another option, or remove it.
  • The setTimeout in the .sm-continue click handler of script.js: replace it with a fetch() call that saves the choice and moves to payment.

Use cases

  • Online stores: shoppers pick standard, express or store pickup between the address and payment steps
  • Checkout flows: each option shows its price and a delivery date that skips weekends
  • Order summaries: shipping cost, tax and total update the moment a method is selected
  • Multi-step checkouts: a progress list marks the current step
  • International shops: delivery dates use the visitor's local date in their own format

Accessibility

The options are a native radio group inside a fieldset with a legend, so Tab enters the group and arrow keys change the selection. The selected card gets a clear :focus-visible outline. Icons are hidden with aria-hidden. The progress list marks the active step with aria-current="step". The total is an aria-live region and .sm-status has role="status", so changes are announced. The card transitions are disabled under prefers-reduced-motion.

Usage notes

Requires Bootstrap 5 (loaded automatically) and Bootstrap Icons. For more than one instance on a page, give each radio group its own name and unique id values. Delivery dates use the visitor's local date, so confirm cut-off times on your server.

Checkout Shipping Method Selection 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
Checkout
License
Free for personal and commercial use

Questions about this template

Can I use the Checkout Shipping Method Selection 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">
Checkout Shipping Method Selection – Bootstrap 5 checkout component screenshot
Checkout Shipping Method Selection · Bootstrap 5 Checkout

More Checkout

One-Page Checkout with Payment Options – Tailwind CSS checkout preview

One-Page Checkout with Payment Options

Tailwind CSS one-page checkout with shipping address, shipping method cards, card / wallet / bank payment tabs, discount code and a live order summary.

Checkout Form with Order Summary – Bootstrap 5 checkout preview

Checkout Form with Order Summary

Bootstrap 5 one-page checkout with contact, shipping, delivery and payment sections, card input masks, validation, promo code and a live order summary.

Order Summary with Coupon – Tailwind CSS checkout preview

Order Summary with Coupon

Tailwind CSS checkout order summary card with a discount code field, live totals, tax and a free shipping progress bar.