Bootstrap 5 Modal Multi-Step Form Wizard
A call-to-action card that opens a modal registration wizard with a progress bar, validation on each step, a plan picker and a confirmation screen.
<section class="wdw-stage mw-stage">
<div class="container" style="max-width:960px">
<div class="wdw-card overflow-hidden">
<div class="row g-0">
<div class="col-lg-6 p-4 p-md-5 d-flex flex-column justify-content-center">
<span class="wdw-eyebrow mb-2">Early access</span>
<h2 class="wdw-heading display-6 mb-3">Join the beta in three quick steps</h2>
<p class="wdw-muted mb-4">Tell us who you are, pick how you will use the product, and choose a plan. It takes about a minute.</p>
<div><button type="button" class="btn btn-primary btn-lg rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#mw-modal">Start registration</button></div>
</div>
<div class="col-lg-6 wdw-aurora p-4 p-md-5 d-flex flex-column justify-content-center gap-3">
<div class="mw-perk"><span class="mw-perk-ico">1</span><div><div class="fw-semibold">Create your account</div><div class="small opacity-75">Name and email, nothing else.</div></div></div>
<div class="mw-perk"><span class="mw-perk-ico">2</span><div><div class="fw-semibold">Tell us about you</div><div class="small opacity-75">So we can tailor your workspace.</div></div></div>
<div class="mw-perk"><span class="mw-perk-ico">3</span><div><div class="fw-semibold">Choose a plan</div><div class="small opacity-75">Free to start, upgrade any time.</div></div></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="mw-modal" tabindex="-1" aria-labelledby="mw-title" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header border-0 pb-0">
<div class="w-100">
<span class="wdw-eyebrow" id="mw-count">Step 1 of 3</span>
<h3 class="modal-title h4 fw-bold" id="mw-title">Create your account</h3>
</div>
<button type="button" class="btn-close align-self-start" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="px-3 pt-3"><div class="progress" style="height:6px" role="progressbar" aria-label="Wizard progress" aria-valuenow="33" aria-valuemin="0" aria-valuemax="100" id="mw-progress"><div class="progress-bar" id="mw-bar" style="width:33%"></div></div></div>
<form id="mw-form" novalidate>
<div class="modal-body p-4">
<div class="mw-step" data-title="Create your account">
<div class="form-floating mb-3"><input type="text" class="form-control" id="mw-name" placeholder="Name" autocomplete="name" required><label for="mw-name">Full name</label><div class="invalid-feedback">Please enter your name.</div></div>
<div class="form-floating mb-3"><input type="email" class="form-control" id="mw-email" placeholder="Email" autocomplete="email" required><label for="mw-email">Email address</label><div class="invalid-feedback">Enter a valid email.</div></div>
<div class="form-floating"><input type="password" class="form-control" id="mw-pass" placeholder="Password" autocomplete="new-password" minlength="8" required><label for="mw-pass">Password</label><div class="invalid-feedback">Use at least 8 characters.</div></div>
</div>
<div class="mw-step d-none" data-title="Tell us about you">
<div class="form-floating mb-3"><input type="text" class="form-control" id="mw-co" placeholder="Company" autocomplete="organization"><label for="mw-co">Company (optional)</label></div>
<div class="form-floating mb-3"><select class="form-select" id="mw-role" required><option value="" selected disabled>Choose…</option><option>Designer</option><option>Developer</option><option>Product manager</option><option>Founder</option></select><label for="mw-role">Your role</label><div class="invalid-feedback">Pick a role.</div></div>
<div class="form-check"><input class="form-check-input" type="checkbox" id="mw-news" checked><label class="form-check-label" for="mw-news">Send me product updates</label></div>
</div>
<div class="mw-step d-none" data-title="Choose a plan">
<div class="d-grid gap-2" role="radiogroup" aria-label="Plan">
<input type="radio" class="btn-check" name="mw-plan" id="mw-p1" checked><label class="btn btn-outline-secondary mw-plan text-start" for="mw-p1"><span class="fw-bold">Starter</span><span class="small wdw-muted d-block">1 project, community support</span><span class="mw-price">Free</span></label>
<input type="radio" class="btn-check" name="mw-plan" id="mw-p2"><label class="btn btn-outline-secondary mw-plan text-start" for="mw-p2"><span class="fw-bold">Pro</span><span class="small wdw-muted d-block">Unlimited projects, priority support</span><span class="mw-price">$12/mo</span></label>
</div>
</div>
<div class="mw-step d-none text-center py-3" data-title="You're all set">
<span class="mw-ok mb-3"><svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span>
<p class="mb-0 wdw-muted">Check your inbox to confirm your email and start using your workspace.</p>
</div>
</div>
<div class="modal-footer border-0 pt-0 justify-content-between">
<button type="button" class="btn btn-outline-secondary rounded-pill px-4" id="mw-back" disabled>Back</button>
<button type="button" class="btn btn-primary rounded-pill px-4" id="mw-next">Continue</button>
</div>
</form>
</div>
</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 */
.mw-perk{display:flex;gap:1rem;align-items:center;padding:1rem 1.25rem;border-radius:1rem;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.16);backdrop-filter:blur(6px)}
.mw-perk-ico{flex:none;width:36px;height:36px;border-radius:50%;background:#fff;color:#312e81;font-weight:800;display:inline-flex;align-items:center;justify-content:center}
.mw-stage .btn-outline-secondary{--bs-btn-color:var(--bs-body-color);--bs-btn-border-color:var(--bs-border-color);--bs-btn-hover-bg:var(--bs-tertiary-bg);--bs-btn-hover-color:var(--bs-emphasis-color);--bs-btn-hover-border-color:var(--bs-border-color)}
.mw-stage .modal-content{border-radius:1.25rem}
.mw-plan{position:relative;padding:1rem 1.25rem;border-radius:1rem}
.mw-price{position:absolute;right:1.25rem;top:50%;transform:translateY(-50%);font-weight:700;color:var(--bs-emphasis-color)}
.btn-check:checked+.mw-plan{border-color:var(--bs-primary);background:var(--bs-primary-bg-subtle);color:var(--bs-body-color)}
.btn-check:focus-visible+.mw-plan{outline:2px solid var(--bs-primary);outline-offset:2px}
.mw-ok{width:64px;height:64px;border-radius:50%;background:var(--bs-success-bg-subtle);color:var(--bs-success-text-emphasis);display:inline-flex;align-items:center;justify-content:center}
.mw-stage .btn:focus-visible{outline:2px solid var(--bs-primary);outline-offset:2px}
(function () {
function initWizardModal() {
var modal = document.getElementById('mw-modal');
if (!modal) return;
var steps = modal.querySelectorAll('.mw-step');
var next = document.getElementById('mw-next');
var back = document.getElementById('mw-back');
var bar = document.getElementById('mw-bar');
var progress = document.getElementById('mw-progress');
var count = document.getElementById('mw-count');
var title = document.getElementById('mw-title');
var total = steps.length - 1;
var current = 0;
function show(i) {
current = i;
steps.forEach(function (s, n) { s.classList.toggle('d-none', n !== i); });
var pct = Math.round(Math.min(i + 1, total) / total * 100);
if (i === total) pct = 100;
bar.style.width = pct + '%';
progress.setAttribute('aria-valuenow', pct);
title.textContent = steps[i].dataset.title;
count.textContent = i < total ? 'Step ' + (i + 1) + ' of ' + total : 'Complete';
back.disabled = i === 0 || i === total;
next.textContent = i === total ? 'Done' : (i === total - 1 ? 'Create account' : 'Continue');
}
function valid() {
var ok = true;
steps[current].querySelectorAll('[required]').forEach(function (f) {
var good = f.checkValidity();
f.classList.toggle('is-invalid', !good);
if (!good) ok = false;
});
return ok;
}
next.addEventListener('click', function () {
if (current === total) { bootstrap.Modal.getOrCreateInstance(modal).hide(); return; }
if (valid()) show(current + 1);
});
back.addEventListener('click', function () { if (current > 0) show(current - 1); });
modal.addEventListener('hidden.bs.modal', function () {
document.getElementById('mw-form').reset();
modal.querySelectorAll('.is-invalid').forEach(function (f) { f.classList.remove('is-invalid'); });
show(0);
});
show(0);
}
initWizardModal();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.