Bootstrap 5 Registration Form with Animations
A split-screen registration form with a brand panel, staggered entrance animation, password strength meter and show/hide toggle. Built with Bootstrap 5 floating labels and a small vanilla script.
<section class="wdw-stage">
<div class="container" style="max-width:960px">
<div class="wdw-card overflow-hidden">
<div class="row g-0">
<aside class="col-lg-5 wdw-aurora p-4 p-md-5 d-flex flex-column justify-content-between reg-side">
<div>
<span class="wdw-eyebrow text-white opacity-75">Join us</span>
<h1 class="h2 fw-bold mt-2 mb-3" style="letter-spacing:-.02em">Create your account</h1>
<p class="opacity-75 mb-0">Set up a free profile in under a minute and pick up right where you left off on any device.</p>
</div>
<figure class="d-none d-lg-block mt-5 mb-0 p-3 rounded-4 reg-quote">
<blockquote class="small mb-3">"I had my workspace set up in a couple of minutes and haven't looked back."</blockquote>
<figcaption class="d-flex align-items-center gap-3">
<span class="d-flex"><span class="reg-av" style="background:#818cf8">AK</span><span class="reg-av" style="background:#ec4899">MR</span><span class="reg-av" style="background:#6366f1">JT</span></span>
<span class="small opacity-75">Joined by 12,000+ people</span>
</figcaption>
</figure>
<ul class="list-unstyled d-none d-lg-grid gap-3 mt-4 mb-0 small">
<li class="d-flex gap-2 align-items-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>No credit card needed</li>
<li class="d-flex gap-2 align-items-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Cancel any time</li>
<li class="d-flex gap-2 align-items-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Your data stays yours</li>
</ul>
</aside>
<div class="col-lg-7 p-4 p-md-5">
<form class="reg-form" novalidate>
<h2 class="h4 fw-bold mb-1">Sign up</h2>
<p class="wdw-muted mb-4">Free forever. No credit card needed.</p>
<div class="row g-3">
<div class="col-sm-6 reg-item" style="--i:0"><div class="form-floating"><input class="form-control" id="reg-first" placeholder="First name" autocomplete="given-name" required><label for="reg-first">First name</label></div></div>
<div class="col-sm-6 reg-item" style="--i:1"><div class="form-floating"><input class="form-control" id="reg-second" placeholder="Second name" autocomplete="family-name" required><label for="reg-second">Second name</label></div></div>
<div class="col-12 reg-item" style="--i:2"><div class="form-floating"><input type="email" class="form-control" id="reg-email" placeholder="Email" autocomplete="email" required><label for="reg-email">Email</label><div class="invalid-feedback">Enter a valid email address.</div></div></div>
<div class="col-12 reg-item" style="--i:3"><div class="form-floating"><input class="form-control" id="reg-login" placeholder="Username" autocomplete="username" required><label for="reg-login">Username</label></div></div>
<div class="col-12 reg-item" style="--i:4">
<div class="position-relative">
<div class="form-floating">
<input type="password" class="form-control pe-5 me-4" id="reg-pass" placeholder="Password" autocomplete="new-password" minlength="8" required>
<label for="reg-pass">Password</label>
</div>
<button class="btn btn-link p-0 px-2 small fw-semibold text-decoration-none reg-toggle" type="button" id="reg-toggle" aria-label="Show password" aria-pressed="false">Show</button>
</div>
<div class="d-none mt-3" id="reg-strength">
<div class="progress" style="height:4px" role="progressbar" aria-label="Password strength" aria-valuemin="0" aria-valuemax="4" aria-valuenow="0"><div class="progress-bar" id="reg-meter" style="width:0"></div></div>
<div class="small fw-semibold mt-2" id="reg-label"></div>
</div>
<div class="small wdw-muted mt-2 mb-1" id="reg-hint">Use 8+ characters with a mix of letters and numbers.</div>
</div>
<div class="col-12 reg-item" style="--i:5"><button class="btn btn-primary rounded-pill w-100" type="submit">Create account</button></div>
<div class="col-12 reg-item" style="--i:6">
<div class="d-flex align-items-center gap-3 wdw-muted small my-1"><hr class="flex-grow-1 m-0"><span>or continue with</span><hr class="flex-grow-1 m-0"></div>
</div>
<div class="col-6 reg-item" style="--i:7"><button type="button" class="btn btn-outline-secondary rounded-pill w-100">Google</button></div>
<div class="col-6 reg-item" style="--i:8"><button type="button" class="btn btn-outline-secondary rounded-pill w-100">GitHub</button></div>
<p class="col-12 text-center small wdw-muted mb-0 reg-item" style="--i:9">By signing up you agree to our terms and privacy policy.<br>Already registered? <a href="#" class="link-primary fw-semibold link-underline-opacity-0">Sign in</a></p>
</div>
<div class="alert alert-success d-none mt-3 mb-0" role="status" id="reg-ok">Account created. Welcome aboard!</div>
</form>
</div>
</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 */
.reg-item { animation: reg-in .5s cubic-bezier(.2,.7,.3,1) backwards; animation-delay: calc(var(--i) * 70ms + 100ms); }
@keyframes reg-in { from { opacity: 0; transform: translateY(12px); } }
.reg-side > * { position: relative; z-index: 1; }
.reg-toggle { position: absolute; top: 50%; right: .75rem; transform: translateY(-50%); z-index: 5; }
.reg-quote { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.reg-av { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: #fff; border: 2px solid #1e1b4b; margin-left: -.5rem; }
.reg-av:first-child { margin-left: 0; }
#reg-meter { transition: width .3s ease, background-color .3s; }
@media (prefers-reduced-motion: reduce) { .reg-item { animation: none; } #reg-meter { transition: none; } }
function initPasswordToggle() {
const btn = document.getElementById('reg-toggle');
const input = document.getElementById('reg-pass');
if (!btn || !input) return;
btn.addEventListener('click', () => {
const show = input.type === 'password';
input.type = show ? 'text' : 'password';
btn.textContent = show ? 'Hide' : 'Show';
btn.setAttribute('aria-pressed', String(show));
btn.setAttribute('aria-label', show ? 'Hide password' : 'Show password');
});
}
function initPasswordMeter() {
const input = document.getElementById('reg-pass');
const bar = document.getElementById('reg-meter');
const hint = document.getElementById('reg-hint');
const wrap = document.getElementById('reg-strength');
const label = document.getElementById('reg-label');
if (!input || !bar || !hint || !wrap || !label) return;
const levels = [['Too short', 'danger'], ['Weak', 'danger'], ['Okay', 'warning'], ['Good', 'success'], ['Strong', 'success']];
input.addEventListener('input', () => {
const v = input.value;
let s = 0;
if (v.length >= 8) s++;
if (/[a-z]/.test(v) && /[A-Z]/.test(v)) s++;
if (/\d/.test(v)) s++;
if (/[^A-Za-z0-9]/.test(v) || v.length >= 14) s++;
if (!v) s = 0;
bar.style.width = (s * 25) + '%';
bar.className = 'progress-bar bg-' + levels[s][1];
bar.parentElement.setAttribute('aria-valuenow', s);
wrap.classList.toggle('d-none', !v);
label.textContent = 'Strength: ' + levels[s][0];
label.className = 'small fw-semibold mt-2 text-' + levels[s][1] + '-emphasis';
});
}
function initRegForm() {
const form = document.querySelector('.reg-form');
if (!form) return;
form.addEventListener('submit', (e) => {
e.preventDefault();
let ok = true;
form.querySelectorAll('input[required]').forEach((f) => {
const valid = f.checkValidity();
f.classList.toggle('is-invalid', !valid);
if (!valid) ok = false;
});
document.getElementById('reg-ok').classList.toggle('d-none', !ok);
});
}
initPasswordToggle();
initPasswordMeter();
initRegForm();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.