Skip to content

Checkout Multi-Step Form

Bootstrap 6 checkout in four steps (address, shipping, payment, review) with a stepper, country Combobox, live order totals, promo code and card checks.

Also known as: multi step checkout, checkout form steps, checkout wizard, step by step checkout, ecommerce checkout form

Checkout Multi-Step Form live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A four-step checkout form for Bootstrap 6: shipping address, shipping method, payment and a final review, next to a live order summary. It suits online stores and booking pages. A Bootstrap 6 stepper shows progress, and totals update when the delivery option or promo code changes.

How it works

The root .cko-root holds two cards: .cko-main with the form and .cko-summary with items and totals. Above the form, .stepper with sm:stepper-horizontal sits inside a .contains-inline wrapper, so it turns horizontal when the card is at least 576px wide and stays vertical on phones.

Each step is a <fieldset class="cko-panel"> with a data-cko-panel number. The submit button moves forward only when every field in the visible panel passes checkValidity(); failed fields get .is-invalid and focus. The country field is a Bootstrap 6 Combobox (data-bs-toggle="combobox", data-bs-search="true", data-bs-name="country") with United States preselected through .selected.

Shipping options are .form-field-card radios with data-cko-price, data-cko-days and data-cko-label. The deliveryDate() helper counts business days from today, so arrival dates never go stale. updateTotals() recalculates discount, shipping, 8% tax and the total.

Payment fields format themselves as the user types. customRules() adds a Luhn check for the card number and rejects past expiry dates through setCustomValidity(). The review step fills .cko-r-address, .cko-r-shipping and .cko-r-payment, and each data-cko-goto button jumps back to that step. Placing the order shows a spinner, then the .cko-success panel with an order number and arrival date.

Customization

  • --cko-brand, --cko-bg and --cko-paper on .cko-root: change the green accent (buttons, stepper, radios, checks) and the page and card colors.
  • data-cko-subtotal on .cko-totals: set the cart subtotal that every total is based on.
  • TAX_RATE and PROMO_CODES at the top of script.js: adjust tax and add discount codes such as { SPRING20: 0.2 }.
  • data-cko-price and data-cko-days on each shipping radio: change prices and delivery estimates.
  • Add .menu-item buttons with data-bs-value to the country menu to support more countries.
  • Replace the setTimeout in the submit handler with a fetch() POST of new FormData(form).

Use cases

  • Online stores: four steps cover address, shipping, payment and a final review
  • Order flows: a stepper shows where the customer is in the checkout
  • Cart and payment pages: live order totals update with the shipping choice and a promo code
  • International shops: a country select and card checks validate the details before ordering

Accessibility

Every step is a <fieldset> with a visible <legend>. Errors are linked with aria-describedby and announced through aria-invalid. Focus moves to the first field of each step, to the first invalid field on error, and to the success panel at the end. The Edit buttons include visually hidden text such as "Edit address".

Usage notes

Never collect raw card numbers on your own server: in production, swap the payment fields for your payment provider's hosted fields. The Combobox keeps its choice after "Start a new order", because it has no public reset method in the alpha. In alpha.1 the Combobox also logs a harmless "more than one instance" console error.

Bootstrap 6 notes

Bootstrap 5's .form-select is replaced by the new Combobox. .form-check radios become .radio inside .form-field-card, btn-primary is btn-solid theme-primary, and the icon inside the card field uses .form-adorn. The .stepper component is new in Bootstrap 6. Built on Bootstrap 6.0.0-alpha.1, so APIs may still change.

Checkout Multi-Step Form 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
Multi-step Forms
License
Free for personal and commercial use

Questions about this template

Can I use the Checkout Multi-Step Form 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.

Checkout Multi-Step Form – free Bootstrap 6 multi-step form template
Checkout Multi-Step Form · free Bootstrap 6 multi-step form template

More Multi-step Forms

Onboarding Wizard – free Bootstrap 6 multi-step form template

Onboarding Wizard

Dark Bootstrap 6 onboarding wizard with a vertical stepper, workspace setup, goal tiles, template Chips, email invite chip input and a finish screen.

Multi-Step Form with Progress Bar – free Bootstrap 6 multi-step form template

Multi-Step Form with Progress Bar

Bootstrap 6 three-step signup form with a gradient progress bar, per-step validation, password Strength meter, radio cards, switches and a success screen.

Multi-Step Form with Progress Bar – free Pure CSS multi-step form template

Multi-Step Form with Progress Bar

Four-step signup form with an animated progress bar, numbered step labels, per-step validation, Back and Next buttons and a review summary.

Multi-Step Registration Form – free Bootstrap 5 multi-step form template

Multi-Step Registration Form

Bootstrap 5 three-step registration form with a progress bar, step indicators, per-step validation, password matching, plan cards and a success screen.

Onboarding Wizard – free Tailwind CSS multi-step form template

Onboarding Wizard

Tailwind CSS onboarding wizard with step indicator, progress bar, radio cards, topic chips, validation and an editable summary before finishing.