Bootstrap 5 Registration Form Layouts
A registration form shown in three modern layouts, compact, split with a brand panel, and detailed two-column, with built-in validation and a dark mode that follows the theme.
<section class="wdw-stage">
<div class="container" style="max-width:1040px">
<div class="text-center mb-4">
<span class="wdw-eyebrow">Sign up</span>
<h1 class="wdw-heading h2 mt-1 mb-3">Registration form layouts</h1>
<ul class="nav nav-pills d-inline-flex p-1 rounded-pill bg-body border" id="rf-tabs" role="tablist" aria-label="Choose a layout">
<li class="nav-item" role="presentation"><button type="button" class="nav-link rounded-pill px-4 active" id="rf-t-split" data-bs-toggle="pill" data-bs-target="#rf-p-split" role="tab" aria-controls="rf-p-split" aria-selected="true">Split</button></li>
<li class="nav-item" role="presentation"><button type="button" class="nav-link rounded-pill px-4" id="rf-t-compact" data-bs-toggle="pill" data-bs-target="#rf-p-compact" role="tab" aria-controls="rf-p-compact" aria-selected="false" tabindex="-1">Compact</button></li>
<li class="nav-item" role="presentation"><button type="button" class="nav-link rounded-pill px-4" id="rf-t-detailed" data-bs-toggle="pill" data-bs-target="#rf-p-detailed" role="tab" aria-controls="rf-p-detailed" aria-selected="false" tabindex="-1">Detailed</button></li>
</ul>
</div>
<div class="alert alert-success d-flex align-items-center gap-2 mx-auto rf-ok" role="status" aria-live="polite" style="max-width:460px" hidden>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="flex-shrink-0"><circle cx="12" cy="12" r="10"/><path d="m8 12 3 3 5-6"/></svg>
<span>Thanks! Your registration was received.</span>
</div>
<div class="tab-content">
<!-- Compact -->
<div class="tab-pane fade" id="rf-p-compact" role="tabpanel" aria-labelledby="rf-t-compact" tabindex="0">
<form class="wdw-card p-4 p-md-5 mx-auto needs-validation" style="max-width:460px" novalidate>
<h2 class="h4 fw-bold mb-1">Create your account</h2>
<p class="wdw-muted small mb-4">It takes less than a minute.</p>
<div class="form-floating mb-3">
<input type="text" class="form-control" id="c-name" placeholder="Name" minlength="2" required autocomplete="name">
<label for="c-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="c-email" placeholder="Email" required autocomplete="email">
<label for="c-email">Email address</label>
<div class="invalid-feedback">Enter a valid email address.</div>
</div>
<div class="row g-3 mb-3">
<div class="col-5">
<div class="form-floating">
<input type="number" class="form-control" id="c-age" placeholder="Age" min="16" max="120" required>
<label for="c-age">Age</label>
<div class="invalid-feedback">16 or older.</div>
</div>
</div>
<div class="col-7">
<div class="form-floating">
<input type="tel" class="form-control" id="c-tel" placeholder="Phone" pattern="[0-9+()\- ]{7,}" required autocomplete="tel">
<label for="c-tel">Telephone</label>
<div class="invalid-feedback">Enter a valid number.</div>
</div>
</div>
</div>
<div class="form-check mb-4 d-flex align-items-center gap-2 ps-0" style="min-height:44px">
<input class="form-check-input mt-0 ms-0 flex-shrink-0" type="checkbox" id="c-agree" required>
<label class="form-check-label small" for="c-agree">I accept the privacy policy</label>
<div class="invalid-feedback">You must accept to continue.</div>
</div>
<button class="btn btn-primary rounded-pill w-100" type="submit">Create account</button>
</form>
</div>
<!-- Split -->
<div class="tab-pane fade show active" id="rf-p-split" role="tabpanel" aria-labelledby="rf-t-split" tabindex="0">
<div class="wdw-card overflow-hidden">
<div class="row g-0">
<div class="col-lg-5 wdw-aurora p-4 p-md-5 d-flex flex-column justify-content-between">
<span class="fw-bold d-inline-flex align-items-center gap-2">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2l3 7h7l-5.5 4.5L18.5 21 12 16.5 5.5 21l2-7.5L2 9h7z"/></svg>
Northwind
</span>
<div class="my-4">
<h2 class="h3 fw-bold mb-2">Join 40,000 designers shipping faster.</h2>
<p class="mb-0 opacity-75">Free for individuals. No credit card needed.</p>
</div>
<ul class="list-unstyled small mb-4 d-grid gap-2">
<li>✓ Unlimited projects</li>
<li>✓ Team sharing</li>
<li>✓ Cancel anytime</li>
</ul>
<figure class="rf-quote rounded-4 p-3 mb-0">
<blockquote class="small mb-3">“We moved our whole design workflow over in an afternoon. Handoff is finally painless.”</blockquote>
<figcaption class="d-flex align-items-center gap-3">
<span class="d-flex">
<img src="https://i.pravatar.cc/80?img=47" width="36" height="36" class="rounded-circle border border-2 border-white" alt="">
<img src="https://i.pravatar.cc/80?img=12" width="36" height="36" class="rounded-circle border border-2 border-white" alt="" style="margin-left:-10px">
<img src="https://i.pravatar.cc/80?img=32" width="36" height="36" class="rounded-circle border border-2 border-white" alt="" style="margin-left:-10px">
</span>
<span class="small"><strong class="d-block">Maya Lindqvist</strong><span class="opacity-75">Design lead, Fjord Studio</span></span>
</figcaption>
</figure>
</div>
<div class="col-lg-7">
<form class="p-4 p-md-5 needs-validation" novalidate>
<h2 class="h4 fw-bold mb-4">Your details</h2>
<div class="row g-3">
<div class="col-sm-6">
<label for="s-first" class="form-label small fw-semibold">First name</label>
<input type="text" class="form-control" id="s-first" required autocomplete="given-name">
<div class="invalid-feedback">Required.</div>
</div>
<div class="col-sm-6">
<label for="s-last" class="form-label small fw-semibold">Last name</label>
<input type="text" class="form-control" id="s-last" required autocomplete="family-name">
<div class="invalid-feedback">Required.</div>
</div>
<div class="col-12">
<label for="s-email" class="form-label small fw-semibold">Work email</label>
<input type="email" class="form-control" id="s-email" placeholder="[email protected]" required autocomplete="email">
<div class="invalid-feedback">Enter a valid email address.</div>
</div>
<div class="col-12">
<label for="s-pass" class="form-label small fw-semibold">Password</label>
<div class="input-group has-validation">
<input type="password" class="form-control" id="s-pass" minlength="8" required autocomplete="new-password" aria-describedby="s-pass-hint">
<button class="btn btn-outline-secondary" type="button" data-rf-reveal="s-pass" aria-label="Show password" aria-pressed="false">Show</button>
<div class="invalid-feedback">Use 8 characters or more.</div>
</div>
<div class="progress mt-2" style="height:4px" aria-hidden="true"><div class="progress-bar rf-meter" style="width:0"></div></div>
<div class="form-text" id="s-pass-hint">Password strength: <span class="rf-meter-label">enter a password</span></div>
</div>
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="s-agree" required>
<label class="form-check-label small" for="s-agree">I agree to the <a href="#">terms</a> and <a href="#">privacy policy</a></label>
<div class="invalid-feedback">You must agree to continue.</div>
</div>
</div>
</div>
<button class="btn btn-primary rounded-pill px-4 mt-4" type="submit">Create account</button>
</form>
</div>
</div>
</div>
</div>
<!-- Detailed -->
<div class="tab-pane fade" id="rf-p-detailed" role="tabpanel" aria-labelledby="rf-t-detailed" tabindex="0">
<form class="wdw-card p-4 p-md-5 mx-auto needs-validation" style="max-width:760px" novalidate>
<h2 class="h4 fw-bold mb-1">Registration</h2>
<p class="wdw-muted small mb-4">Tell us a little about yourself.</p>
<div class="row g-3">
<div class="col-md-6">
<label for="d-first" class="form-label small fw-semibold">First name</label>
<input type="text" class="form-control" id="d-first" required>
<div class="invalid-feedback">Required.</div>
</div>
<div class="col-md-6">
<label for="d-last" class="form-label small fw-semibold">Last name</label>
<input type="text" class="form-control" id="d-last" required>
<div class="invalid-feedback">Required.</div>
</div>
<div class="col-md-6">
<label for="d-pass" class="form-label small fw-semibold">Password</label>
<input type="password" class="form-control" id="d-pass" minlength="8" required>
<div class="invalid-feedback">At least 8 characters.</div>
</div>
<div class="col-md-6">
<label for="d-pass2" class="form-label small fw-semibold">Confirm password</label>
<input type="password" class="form-control" id="d-pass2" required data-match="d-pass">
<div class="invalid-feedback">Passwords do not match.</div>
</div>
<div class="col-md-6">
<label for="d-email" class="form-label small fw-semibold">Email</label>
<input type="email" class="form-control" id="d-email" required>
<div class="invalid-feedback">Enter a valid email address.</div>
</div>
<div class="col-md-6">
<label for="d-gender" class="form-label small fw-semibold">Gender</label>
<select class="form-select" id="d-gender" required>
<option value="" selected disabled>Select</option>
<option>Female</option><option>Male</option><option>Non-binary</option><option>Prefer not to say</option>
</select>
<div class="invalid-feedback">Please choose one.</div>
</div>
<div class="col-12">
<label for="d-addr" class="form-label small fw-semibold">Address</label>
<input type="text" class="form-control" id="d-addr" autocomplete="street-address">
</div>
<div class="col-md-6">
<label for="d-tel" class="form-label small fw-semibold">Phone</label>
<input type="tel" class="form-control" id="d-tel" autocomplete="tel">
</div>
<div class="col-md-6">
<label for="d-zip" class="form-label small fw-semibold">Postal code</label>
<input type="text" class="form-control" id="d-zip" autocomplete="postal-code">
</div>
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="d-agree" required>
<label class="form-check-label small" for="d-agree">I agree to the terms and conditions</label>
<div class="invalid-feedback">You must agree to continue.</div>
</div>
</div>
</div>
<button class="btn btn-primary rounded-pill px-5 mt-4" type="submit">Register</button>
</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 */
.nav-pills { --bs-nav-link-padding-y: .5rem; --bs-nav-pills-link-active-color: #fff; }
[data-bs-theme="dark"] #rf-tabs .nav-link.active { color: #0f1117; }
.rf-quote { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.rf-meter { transition: width .2s; }
.rf-ok[hidden] { display: none !important; }
.was-validated .form-control:valid, .was-validated .form-select:valid { border-color: var(--bs-border-color); background-image: none; padding-right: .75rem; }
.was-validated .form-check-input:valid { border-color: var(--bs-border-color); }
.was-validated .form-check-input:valid ~ .form-check-label { color: inherit; }
.was-validated .form-check-input:valid:checked { background-color: var(--bs-primary); }
(function () {
function initReveal() {
document.querySelectorAll('[data-rf-reveal]').forEach(function (btn) {
var input = document.getElementById(btn.dataset.rfReveal);
if (!input) return;
btn.addEventListener('click', function () {
var show = input.type === 'password';
input.type = show ? 'text' : 'password';
btn.textContent = show ? 'Hide' : 'Show';
btn.setAttribute('aria-label', show ? 'Hide password' : 'Show password');
btn.setAttribute('aria-pressed', show);
});
});
}
function initStrength() {
var input = document.getElementById('s-pass');
var bar = document.querySelector('.rf-meter');
var label = document.querySelector('.rf-meter-label');
if (!input || !bar || !label) return;
var levels = [
['enter a password', 0, 'bg-secondary'],
['weak', 25, 'bg-danger'],
['fair', 50, 'bg-warning'],
['good', 75, 'bg-info'],
['strong', 100, 'bg-success']
];
input.addEventListener('input', function () {
var v = input.value;
var score = v ? 1 : 0;
if (v.length >= 8) score++;
if (/[A-Z]/.test(v) && /[a-z]/.test(v)) score++;
if (/\d/.test(v) && /[^A-Za-z0-9]/.test(v)) score++;
var l = levels[score];
bar.style.width = l[1] + '%';
bar.className = 'progress-bar rf-meter ' + l[2];
label.textContent = l[0];
});
}
function initValidation() {
var ok = document.querySelector('.rf-ok');
document.querySelectorAll('.needs-validation').forEach(function (form) {
form.addEventListener('submit', function (e) {
e.preventDefault();
var match = form.querySelector('[data-match]');
if (match) {
var other = document.getElementById(match.dataset.match);
match.setCustomValidity(other && other.value !== match.value ? 'mismatch' : '');
}
if (!form.checkValidity()) {
form.classList.add('was-validated');
var bad = form.querySelector(':invalid');
if (bad) bad.focus();
if (ok) ok.hidden = true;
return;
}
form.classList.remove('was-validated');
form.reset();
var meter = document.querySelector('.rf-meter');
if (meter) meter.style.width = '0';
if (ok) { ok.hidden = false; ok.scrollIntoView({ block: 'nearest' }); }
});
});
}
initReveal();
initStrength();
initValidation();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.