Skip to content

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.

Also known as: multi step signup form, form wizard, stepper form, step by step form, onboarding form

Multi-Step Form with Progress Bar live demo

Open in new tab

Pure CSS code (HTML, CSS, JS)

A four-step signup form with a progress bar and numbered step labels at the top, plus Back and Next buttons. Built with plain CSS and vanilla JavaScript, it suits onboarding flows, account creation, checkout or any long form that is easier to fill in small pieces.

How it works

The root form.msf-form sits inside a .msf-wrap background. At the top are the .msf-progress bar with its .msf-progress-fill, and the ol.msf-steps list of .msf-step items. Each step of the form is a fieldset.msf-panel with a data-msf-step number; only the current one is visible, the others carry hidden. The last panel shows a dl.msf-summary whose [data-msf-show] cells are filled from the form data, and a .msf-done message replaces the form after submitting.

The Next button is the form's submit button, so Enter also advances. On submit the script validates only the fields of the visible panel with checkValidity() and an extra email pattern, adds .is-invalid to the wrapping .msf-field to reveal its .msf-error, and focuses the first invalid field. When the step is valid it moves on, sets the --msf-progress custom property on the form (25%, 50%, 75%, 100%) and marks earlier steps with .is-done. The final submit is simulated with a short timeout; replace it with fetch() to your API where the comment says so.

Customization

  • --msf-accent and --msf-accent-soft on .msf-wrap: the color of the progress fill, finished step circles, the primary button and the selected plan card.
  • --msf-bar-height: the thickness of the progress bar, for example 4px for a thinner line.
  • --msf-speed: the duration of the fill animation and the panel slide-in.
  • --msf-radius: the corner radius of the plan cards and the summary box.
  • Add a step by copying a fieldset.msf-panel and an li.msf-step, then update the "of 4" text in .msf-counter; the percentage is calculated from the number of panels.
  • Edit the messages inside each .msf-error to change the validation text.

Use cases

  • Account creation: break signup into four short steps with a progress bar on top
  • Onboarding flows: numbered step labels show where the user is and what comes next
  • Checkout and booking forms: validate each step before moving on and review everything at the end
  • Long applications: a Back button lets users fix earlier answers without losing data
  • Plan selection: radio plan cards sit inside a step before the final summary

Accessibility

The bar uses role="progressbar" with aria-valuenow updated on every step, and the active .msf-step gets aria-current="step". The step counter is an aria-live region, so screen readers hear "Step 2 of 4". Each panel is a fieldset with a legend. Invalid fields get aria-invalid="true" and aria-describedby pointing to their error text. Focus moves to the first field of each new step and to the success message at the end. The plan cards are real radio inputs with a visible focus ring, and animations are removed under prefers-reduced-motion.

Usage notes

The plan cards use :has() for the selected style; in older browsers the radios still work. Several forms can share a page because the script scopes every query to its own .msf-form.

Multi-Step Form with Progress Bar at a glance

Framework
Pure CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
None
Layout
Responsive, works on mobile
Category
Multi-step Forms
License
Free for personal and commercial use

Questions about this template

Can I use the Multi-Step Form with Progress Bar 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?

There is nothing to install. 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

No dependencies. Pure HTML, CSS and JavaScript.

Multi-Step Form with Progress Bar – Pure CSS multi-step forms component screenshot
Multi-Step Form with Progress Bar · Pure CSS Multi-step Forms

More Multi-step Forms

Multi-Step Registration Form – Bootstrap 5 multi-step forms preview

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 – Tailwind CSS multi-step forms preview

Onboarding Wizard

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