Bootstrap 5 Signup Form with Image on Left
A two-column sign-up form with a full-height photo, floating-label fields, a show/hide password toggle with strength meter, and terms checkbox with validation.
<section class="wdw-stage">
<div class="container" style="max-width:980px">
<div class="wdw-card overflow-hidden">
<div class="row g-0">
<div class="col-lg-5 d-none d-lg-block su-photo position-relative">
<img src="https://images.unsplash.com/photo-1441974231531-c6227db76b6e?auto=format&fit=crop&w=900&q=70" alt="Sunlight falling through tall forest trees">
<div class="su-scrim position-absolute bottom-0 start-0 end-0 p-4 text-white">
<p class="h5 fw-bold mb-1">Grow something good.</p>
<p class="small mb-0 opacity-75">Join 20,000 makers building in the open.</p>
</div>
</div>
<div class="col-lg-7">
<form class="p-4 p-md-5" id="signup-form" novalidate>
<span class="wdw-eyebrow">Get started</span>
<h1 class="h2 wdw-heading mb-1">Create your account</h1>
<p class="wdw-muted mb-4">Free for 14 days. No credit card needed.</p>
<div class="form-floating mb-3">
<input type="email" class="form-control" id="su-email" placeholder="Email" autocomplete="email" required>
<label for="su-email">Email address</label>
</div>
<div class="mb-3">
<div class="input-group su-pass">
<div class="form-floating flex-grow-1">
<input type="password" class="form-control" id="su-pass" placeholder="Password" autocomplete="new-password" required minlength="8">
<label for="su-pass">Password</label>
</div>
<button class="btn btn-outline-secondary" type="button" id="su-toggle" aria-label="Show password" aria-pressed="false">Show</button>
</div>
<div class="progress mt-2" style="height:.3rem" aria-hidden="true"><div class="progress-bar" id="su-meter" style="width:0"></div></div>
<div class="form-text" id="su-hint" aria-live="polite">Use 8+ characters with a mix of letters and numbers.</div>
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="su-pass2" placeholder="Repeat password" autocomplete="new-password" required>
<label for="su-pass2">Repeat password</label>
<div class="invalid-feedback" id="su-match">Passwords do not match.</div>
</div>
<div class="form-check mb-4">
<input class="form-check-input" type="checkbox" id="su-terms" required>
<label class="form-check-label small" for="su-terms">I agree to the <a href="#">license terms</a> and privacy policy.</label>
</div>
<button type="submit" class="btn btn-primary rounded-pill w-100">Sign up</button>
<div class="small text-center mt-3" role="status" id="su-status"></div>
<p class="small wdw-muted text-center mt-4 mb-0">Already have an account? <a href="#" class="fw-semibold text-decoration-none">Log in</a></p>
</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 */
.su-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.su-scrim { background: linear-gradient(to top, rgba(8, 10, 24, .85), rgba(8, 10, 24, 0)); padding-top: 4rem !important; }
.su-pass .btn { min-width: 4.5rem; --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--bs-border-color); --bs-btn-hover-color: var(--bs-emphasis-color); --bs-btn-hover-bg: var(--bs-tertiary-bg); --bs-btn-hover-border-color: var(--bs-border-color); --bs-btn-active-color: var(--bs-emphasis-color); --bs-btn-active-bg: var(--bs-secondary-bg); --bs-btn-active-border-color: var(--bs-border-color); }
.su-pass .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.progress-bar { transition: width .3s ease, background-color .3s; }
function initSignupForm() {
var form = document.getElementById('signup-form');
if (!form) return;
var pass = document.getElementById('su-pass');
var pass2 = document.getElementById('su-pass2');
var meter = document.getElementById('su-meter');
var hint = document.getElementById('su-hint');
var toggle = document.getElementById('su-toggle');
var status = document.getElementById('su-status');
var levels = [
{ w: '0%', c: '', t: 'Use 8+ characters with a mix of letters and numbers.' },
{ w: '25%', c: 'var(--bs-danger)', t: 'Weak. Add more characters.' },
{ w: '50%', c: 'var(--bs-warning)', t: 'Fair. Try adding numbers or symbols.' },
{ w: '75%', c: 'var(--bs-info)', t: 'Good password.' },
{ w: '100%', c: 'var(--bs-success)', t: 'Strong password.' }
];
function score(v) {
if (!v) return 0;
var 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++;
return Math.max(s, 1);
}
pass.addEventListener('input', function () {
var l = levels[score(pass.value)];
meter.style.width = l.w;
meter.style.backgroundColor = l.c;
hint.textContent = l.t;
});
toggle.addEventListener('click', function () {
var show = pass.type === 'password';
pass.type = show ? 'text' : 'password';
toggle.textContent = show ? 'Hide' : 'Show';
toggle.setAttribute('aria-pressed', show);
toggle.setAttribute('aria-label', show ? 'Hide password' : 'Show password');
});
form.addEventListener('submit', function (e) {
e.preventDefault();
pass2.setCustomValidity(pass2.value && pass2.value !== pass.value ? 'mismatch' : '');
form.classList.add('was-validated');
var ok = form.checkValidity();
status.className = 'small text-center mt-3 ' + (ok ? 'text-success' : 'text-danger');
status.textContent = ok ? 'Account created. This demo has no backend.' : 'Please fix the highlighted fields.';
});
}
initSignupForm();
<section class="signup-stage">
<div class="signup-card">
<div class="signup-media">
<img src="https://images.unsplash.com/photo-1518531933037-91b2f5f229cc?w=900&q=80" alt="Close-up of a green leaf with fine veins" width="900" height="1100">
<p class="signup-quote">Small steps, grown daily.</p>
</div>
<form class="signup-form" method="post" action="#" data-bs-validate novalidate>
<h2 class="fs-2xl signup-title"><strong>Create</strong> an account</h2>
<p class="fg-secondary signup-sub">Free for 14 days. No credit card required.</p>
<div class="form-field">
<label class="form-label" for="su-email">Email</label>
<input class="form-control" type="email" id="su-email" name="email" placeholder="[email protected]" autocomplete="email" required>
</div>
<div class="form-field">
<label class="form-label" for="su-pass">Password</label>
<input class="form-control" type="password" id="su-pass" name="password" placeholder="At least 8 characters" autocomplete="new-password" minlength="8" required>
</div>
<div class="form-field">
<label class="form-label" for="su-pass2">Repeat password</label>
<input class="form-control" type="password" id="su-pass2" name="password-repeat" placeholder="Repeat your password" autocomplete="new-password" required>
</div>
<div class="form-field">
<input class="check" type="checkbox" id="su-terms" required>
<label for="su-terms">I agree to the license terms.</label>
</div>
<button class="btn-solid theme-primary btn-lg w-100" type="submit">Sign up</button>
<p class="fs-sm fg-secondary signup-foot">Already have an account? <a href="#">Log in here</a></p>
</form>
</div>
</section>
.signup-stage {
min-height: 100vh;
display: grid;
place-items: center;
padding: 2rem 1rem;
background: var(--bs-bg-2);
}
.signup-card {
display: grid;
grid-template-columns: 1fr;
width: 100%;
max-width: 920px;
overflow: hidden;
background: var(--bs-bg-body);
border: 1px solid var(--bs-border-color);
border-radius: var(--bs-radius-6);
box-shadow: 0 20px 50px -24px rgb(0 0 0 / .25);
}
.signup-media { position: relative; display: none; min-height: 100%; }
.signup-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.signup-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .55), transparent 55%); }
.signup-quote { position: absolute; z-index: 1; left: 1.75rem; right: 1.75rem; bottom: 1.5rem; margin: 0; color: #fff; font-size: 1.25rem; font-weight: 600; }
.signup-form { display: flex; flex-direction: column; gap: 1rem; padding: 2rem 1.5rem; }
.signup-title { margin-bottom: 0; }
.signup-sub { margin-bottom: .5rem; }
.signup-foot { margin: .5rem 0 0; text-align: center; }
@media (width >= 768px) {
.signup-card { grid-template-columns: 1fr 1fr; }
.signup-media { display: block; }
.signup-form { padding: 3rem; }
}
Built on Bootstrap 6.0.0-alpha.1 (ES modules, no jQuery). Load Bootstrap through an import map and run the JavaScript as type="module" — the downloaded file is already set up that way. Alpha releases can still change class names.
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.