Bootstrap 5 Multi-Step Signup Form Wizard
A four-step signup wizard with a progress tracker, floating-label fields, per-step validation and a success screen.
<section class="wdw-stage">
<div class="container" style="max-width:640px">
<div class="wdw-card p-4 p-md-5">
<div class="text-center mb-4">
<span class="wdw-eyebrow">Create account</span>
<h2 class="wdw-heading h2 mt-1 mb-1">Sign up in four steps</h2>
<p class="wdw-muted mb-0" id="wzHint">Step 1 of 4: Account</p>
</div>
<ol class="wz-steps list-unstyled d-flex justify-content-between mb-4" id="wzSteps" aria-label="Progress">
<li class="wz-step is-current"><span class="wz-dot">1</span><span class="wz-label">Account</span></li>
<li class="wz-step"><span class="wz-dot">2</span><span class="wz-label">Personal</span></li>
<li class="wz-step"><span class="wz-dot">3</span><span class="wz-label">Payment</span></li>
<li class="wz-step"><span class="wz-dot">4</span><span class="wz-label">Finish</span></li>
</ol>
<form id="wzForm" novalidate>
<fieldset class="wz-pane" data-step="1">
<legend class="visually-hidden">Account details</legend>
<div class="form-floating mb-3"><input type="email" class="form-control" id="wzEmail" placeholder="Email" required><label for="wzEmail">Email address</label><div class="invalid-feedback">Enter a valid email.</div></div>
<div class="form-floating mb-3"><input type="text" class="form-control" id="wzUser" placeholder="Username" required minlength="3"><label for="wzUser">Username</label><div class="invalid-feedback">At least 3 characters.</div></div>
<div class="row g-3">
<div class="col-sm-6"><div class="form-floating"><input type="password" class="form-control" id="wzPass" placeholder="Password" required minlength="6"><label for="wzPass">Password</label><div class="invalid-feedback">At least 6 characters.</div></div></div>
<div class="col-sm-6"><div class="form-floating"><input type="password" class="form-control" id="wzPass2" placeholder="Confirm" required><label for="wzPass2">Confirm password</label><div class="invalid-feedback">Passwords must match.</div></div></div>
</div>
</fieldset>
<fieldset class="wz-pane" data-step="2" hidden>
<legend class="visually-hidden">Personal details</legend>
<div class="row g-3">
<div class="col-sm-6"><div class="form-floating"><input type="text" class="form-control" id="wzFirst" placeholder="First" required><label for="wzFirst">First name</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-sm-6"><div class="form-floating"><input type="text" class="form-control" id="wzLast" placeholder="Last" required><label for="wzLast">Last name</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-12"><div class="form-floating"><input type="tel" class="form-control" id="wzPhone" placeholder="Phone" required><label for="wzPhone">Phone number</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-12"><div class="form-floating"><input type="date" class="form-control" id="wzBirth" placeholder="Birth" required><label for="wzBirth">Date of birth</label><div class="invalid-feedback">Required.</div></div></div>
</div>
</fieldset>
<fieldset class="wz-pane" data-step="3" hidden>
<legend class="visually-hidden">Payment details</legend>
<div class="form-floating mb-3"><input type="text" class="form-control" id="wzCard" inputmode="numeric" placeholder="Card" required pattern="[0-9 ]{13,19}"><label for="wzCard">Card number</label><div class="invalid-feedback">Enter a valid card number.</div></div>
<div class="form-floating mb-3"><input type="text" class="form-control" id="wzHolder" placeholder="Name" required><label for="wzHolder">Name on card</label><div class="invalid-feedback">Required.</div></div>
<div class="row g-3">
<div class="col-6"><div class="form-floating"><input type="text" class="form-control" id="wzExp" placeholder="MM/YY" required pattern="[0-9]{2}/[0-9]{2}"><label for="wzExp">Expiry (MM/YY)</label><div class="invalid-feedback">Use MM/YY.</div></div></div>
<div class="col-6"><div class="form-floating"><input type="text" class="form-control" id="wzCvc" inputmode="numeric" placeholder="CVC" required pattern="[0-9]{3,4}"><label for="wzCvc">CVC</label><div class="invalid-feedback">3 or 4 digits.</div></div></div>
</div>
</fieldset>
<div class="wz-pane text-center py-4" data-step="4" hidden>
<span class="wz-done mx-auto mb-3"><svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span>
<h3 class="h4 fw-bold">You're all set</h3>
<p class="wdw-muted mb-0">Your account is ready. We've sent a confirmation to your inbox.</p>
</div>
<div class="d-flex justify-content-between gap-2 mt-4" id="wzNav">
<button type="button" class="btn btn-outline-secondary rounded-pill px-4" id="wzBack" disabled>Back</button>
<button type="button" class="btn btn-primary rounded-pill px-4" id="wzNext">Next step</button>
</div>
</form>
</div>
</div>
</section>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.wz-steps { position: relative; }
.wz-steps::before { content: ""; position: absolute; top: 18px; left: 12%; right: 12%; height: 2px; background: var(--bs-border-color); }
.wz-step { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.wz-dot { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .875rem; background: var(--bs-body-bg); color: var(--bs-secondary-color); border: 2px solid var(--bs-border-color); transition: all .2s; }
.wz-label { font-size: .75rem; font-weight: 600; color: var(--bs-secondary-color); }
.wz-step.is-current .wz-dot { border-color: var(--bs-primary); color: var(--bs-primary); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.wz-step.is-current .wz-label { color: var(--bs-emphasis-color); }
.wz-step.is-done .wz-dot { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
[data-bs-theme="dark"] .wz-step.is-done .wz-dot { color: #0f1117; }
.wz-pane { border: 0; padding: 0; margin: 0; min-width: 0; }
.wz-pane:not([hidden]) { animation: wzIn .25s ease; }
@keyframes wzIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.wz-done { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
@media (prefers-reduced-motion: reduce) { .wz-pane:not([hidden]) { animation: none; } }
function initSignupWizard() {
var form = document.getElementById('wzForm');
if (!form) return;
var panes = form.querySelectorAll('.wz-pane');
var steps = document.querySelectorAll('#wzSteps .wz-step');
var next = document.getElementById('wzNext');
var back = document.getElementById('wzBack');
var hint = document.getElementById('wzHint');
var names = ['Account', 'Personal', 'Payment', 'Finish'];
var current = 0;
function valid(pane) {
var ok = true;
pane.querySelectorAll('input').forEach(function (input) {
var good = input.checkValidity();
if (input.id === 'wzPass2') good = good && input.value === document.getElementById('wzPass').value;
input.classList.toggle('is-invalid', !good);
if (!good) ok = false;
});
return ok;
}
function show(i) {
current = i;
panes.forEach(function (p, idx) { p.hidden = idx !== i; });
steps.forEach(function (s, idx) {
s.classList.toggle('is-current', idx === i);
s.classList.toggle('is-done', idx < i);
var dot = s.querySelector('.wz-dot');
dot.textContent = idx < i ? '✓' : String(idx + 1);
if (idx === i) s.setAttribute('aria-current', 'step'); else s.removeAttribute('aria-current');
});
hint.textContent = i === 3 ? 'All done' : 'Step ' + (i + 1) + ' of 4: ' + names[i];
back.disabled = i === 0 || i === 3;
next.textContent = i === 2 ? 'Create account' : i === 3 ? 'Start over' : 'Next step';
var first = panes[i].querySelector('input');
if (first) first.focus({ preventScroll: true });
}
next.addEventListener('click', function () {
if (current === 3) { form.reset(); form.querySelectorAll('.is-invalid').forEach(function (x) { x.classList.remove('is-invalid'); }); show(0); return; }
if (!valid(panes[current])) return;
show(current + 1);
});
back.addEventListener('click', function () { if (current > 0) show(current - 1); });
form.addEventListener('submit', function (e) { e.preventDefault(); });
form.addEventListener('keydown', function (e) { if (e.key === 'Enter' && e.target.tagName === 'INPUT') { e.preventDefault(); next.click(); } });
}
initSignupWizard();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.