Bootstrap 5 Multi-Step Feedback Form Wizard
A three-step feedback wizard with a progress indicator, terms agreement, a rating and comment step with inline validation, and a thank-you confirmation. Built with Bootstrap 5 form components and a small vanilla script.
<section class="wdw-stage">
<div class="container" style="max-width:640px">
<form class="wdw-card overflow-hidden fb-wizard" novalidate aria-labelledby="fb-title">
<div class="wdw-aurora text-center px-4 py-4 py-md-5">
<span class="wdw-eyebrow text-white opacity-75">Feedback</span>
<h1 id="fb-title" class="wdw-heading h3 text-white mt-1 mb-0">Tell us how we did</h1>
</div>
<div class="p-4 p-md-5">
<ol class="fb-steps list-unstyled d-flex mt-1 mb-4" aria-label="Progress">
<li class="fb-step active" data-step="0"><span class="fb-dot"><span class="fb-num">1</span><svg class="fb-tick" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span><span class="fb-label">Terms</span></li>
<li class="fb-step" data-step="1"><span class="fb-dot"><span class="fb-num">2</span><svg class="fb-tick" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span><span class="fb-label">Feedback</span></li>
<li class="fb-step" data-step="2"><span class="fb-dot"><span class="fb-num">3</span><svg class="fb-tick" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span><span class="fb-label">Done</span></li>
</ol>
<div class="fb-panel" data-panel="0">
<h2 class="h5 fw-bold mb-3">Before you start</h2>
<ul class="list-unstyled d-grid gap-3 mb-4">
<li class="d-flex gap-3 align-items-center"><span class="wdw-icon"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2 4 5v6c0 5 3.4 9.3 8 11 4.6-1.7 8-6 8-11V5l-8-3Z"/><path d="m9 12 2 2 4-4"/></svg></span><div><div class="fw-semibold">Anonymous by default</div><div class="wdw-muted small">Your answers stay private unless you add an email.</div></div></li>
<li class="d-flex gap-3 align-items-center"><span class="wdw-icon"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 6h16v10H8l-4 4V6Z"/></svg></span><div><div class="fw-semibold">Every response is read</div><div class="wdw-muted small">We reply to feedback, usually within two days.</div></div></li>
<li class="d-flex gap-3 align-items-center"><span class="wdw-icon"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg></span><div><div class="fw-semibold">Takes about a minute</div><div class="wdw-muted small">Three short steps and you are done.</div></div></li>
</ul>
<div class="form-check bg-body-tertiary rounded-3 p-3 ps-5 border">
<input class="form-check-input" type="checkbox" id="fb-agree" required>
<label class="form-check-label" for="fb-agree">I agree to the terms and conditions</label>
<div class="invalid-feedback">Please accept the terms to continue.</div>
</div>
</div>
<div class="fb-panel d-none" data-panel="1">
<div class="row g-3">
<div class="col-sm-6">
<div class="form-floating">
<input type="text" class="form-control" id="fb-name" placeholder="Name" required>
<label for="fb-name">Name</label>
<div class="invalid-feedback">Enter your name.</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-floating">
<input type="email" class="form-control" id="fb-email" placeholder="Email" required>
<label for="fb-email">Email</label>
<div class="invalid-feedback">Enter a valid email.</div>
</div>
</div>
<div class="col-12">
<fieldset>
<legend class="form-label fs-6 fw-semibold">Overall experience</legend>
<div class="fb-stars d-inline-flex flex-row-reverse gap-1" role="radiogroup"><input type="radio" class="btn-check" name="fb-rate" id="r5" value="5" required><label class="fb-star" for="r5" title="Excellent"><svg width="30" height="30" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9L12 3Z"/></svg><span class="visually-hidden">5 out of 5, Excellent</span></label><input type="radio" class="btn-check" name="fb-rate" id="r4" value="4"><label class="fb-star" for="r4" title="Good"><svg width="30" height="30" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9L12 3Z"/></svg><span class="visually-hidden">4 out of 5, Good</span></label><input type="radio" class="btn-check" name="fb-rate" id="r3" value="3"><label class="fb-star" for="r3" title="Okay"><svg width="30" height="30" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9L12 3Z"/></svg><span class="visually-hidden">3 out of 5, Okay</span></label><input type="radio" class="btn-check" name="fb-rate" id="r2" value="2"><label class="fb-star" for="r2" title="Poor"><svg width="30" height="30" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9L12 3Z"/></svg><span class="visually-hidden">2 out of 5, Poor</span></label><input type="radio" class="btn-check" name="fb-rate" id="r1" value="1"><label class="fb-star" for="r1" title="Terrible"><svg width="30" height="30" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9L12 3Z"/></svg><span class="visually-hidden">1 out of 5, Terrible</span></label></div>
<div class="text-danger small mt-2 d-none" id="fb-rate-err">Pick a rating.</div>
</fieldset>
</div>
<div class="col-12">
<div class="form-floating">
<textarea class="form-control fb-text" id="fb-comment" placeholder="Comments" required></textarea>
<label for="fb-comment">What could we improve?</label>
<div class="invalid-feedback">Tell us a little more.</div>
</div>
</div>
</div>
</div>
<div class="fb-panel d-none text-center py-3" data-panel="2" tabindex="-1">
<span class="fb-check mb-3" aria-hidden="true"><svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg></span>
<h2 class="h4 fw-bold">Thank you!</h2>
<p class="wdw-muted mb-0">Your feedback has been sent. We appreciate you taking the time.</p>
</div>
<div class="d-flex justify-content-between gap-2 mt-4">
<button type="button" class="btn btn-outline-primary rounded-pill px-4 invisible" data-prev>Back</button>
<button type="button" class="btn btn-primary rounded-pill px-4" data-next>Start</button>
</div>
</div>
</form>
</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 */
.fb-steps { gap: .5rem; position: relative; }
.fb-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; position: relative; color: var(--bs-secondary-color); font-size: .8125rem; font-weight: 600; }
.fb-step::before { content: ""; position: absolute; top: 1.125rem; right: 50%; width: 100%; height: 2px; background: var(--bs-border-color); z-index: 0; }
.fb-step:first-child::before { display: none; }
.fb-step.done::before, .fb-step.active::before { background: var(--bs-primary); }
.fb-dot { position: relative; z-index: 1; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--bs-tertiary-bg); border: 2px solid var(--bs-border-color); font-weight: 700; transition: all .2s; }
.fb-step.active .fb-dot { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
[data-bs-theme="dark"] .fb-step.active .fb-dot { color: #0f1117; }
.fb-step.done .fb-dot { background: var(--bs-primary-bg-subtle); border-color: var(--bs-primary); color: var(--bs-primary); }
.fb-step.active .fb-label { color: var(--bs-emphasis-color); }
.form-floating > .fb-text.form-control { height: 8rem; min-height: 8rem; }
.fb-check { display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.fb-panel { animation: fb-in .25s ease; }
@keyframes fb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fb-panel { animation: none; } }
.fb-tick { display: none; }
.fb-step.done .fb-tick { display: block; }
.fb-step.done .fb-num { display: none; }
.fb-star { color: var(--bs-border-color); cursor: pointer; line-height: 1; padding: .125rem; border-radius: .5rem; transition: color .15s, transform .15s; }
.fb-star:hover, .fb-star:hover ~ .fb-star, .btn-check:checked ~ .fb-star { color: #f59e0b; }
.fb-star:hover { transform: scale(1.1); }
.btn-check:focus-visible + .fb-star { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
function initFeedbackWizard() {
const form = document.querySelector('.fb-wizard');
if (!form) return;
const panels = form.querySelectorAll('.fb-panel');
const steps = form.querySelectorAll('.fb-step');
const prev = form.querySelector('[data-prev]');
const next = form.querySelector('[data-next]');
const rateErr = form.querySelector('#fb-rate-err');
let current = 0;
const show = (i) => {
current = i;
panels.forEach((p, n) => p.classList.toggle('d-none', n !== i));
steps.forEach((s, n) => {
s.classList.toggle('active', n === i);
s.classList.toggle('done', n < i);
if (n === i) s.setAttribute('aria-current', 'step'); else s.removeAttribute('aria-current');
});
prev.classList.toggle('invisible', i !== 1);
next.classList.toggle('d-none', i === 2);
next.textContent = i === 0 ? 'Start' : 'Submit';
const focusEl = panels[i].querySelector('input,textarea') || panels[i];
focusEl.focus({ preventScroll: true });
};
const validate = (i) => {
const fields = panels[i].querySelectorAll('input[required]:not([type=radio]), textarea[required]');
let ok = true;
fields.forEach((f) => {
const valid = f.type === 'checkbox' ? f.checked : f.checkValidity() && f.value.trim() !== '';
f.classList.toggle('is-invalid', !valid);
f.classList.toggle('is-valid', valid && f.type !== 'checkbox');
if (!valid) ok = false;
});
if (i === 1) {
const rated = !!form.querySelector('input[name="fb-rate"]:checked');
rateErr.classList.toggle('d-none', rated);
if (!rated) ok = false;
}
return ok;
};
next.addEventListener('click', () => { if (validate(current)) show(current + 1); });
prev.addEventListener('click', () => show(current - 1));
form.addEventListener('submit', (e) => e.preventDefault());
form.querySelectorAll('input,textarea').forEach((f) => f.addEventListener('input', () => {
if (f.classList.contains('is-invalid')) validate(current);
}));
form.querySelectorAll('input[name="fb-rate"]').forEach((r) => r.addEventListener('change', () => rateErr.classList.add('d-none')));
}
initFeedbackWizard();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.