Bootstrap 5 Signup Form with Google Login Button
A clean sign-up card with a Google button, floating-label fields, a live password strength meter and inline validation.
<section class="wdw-stage">
<div class="container" style="max-width: 940px">
<div class="wdw-card overflow-hidden">
<div class="row g-0">
<div class="col-lg-5 d-none d-lg-flex wdw-aurora p-5 flex-column justify-content-between signup-brand">
<span class="fw-bold fs-5">Northwind</span>
<div>
<h2 class="h3 fw-bold mb-3">Ship your next idea this week.</h2>
<ul class="list-unstyled d-grid gap-2 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" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>Unlimited projects on the free plan</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" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>No credit card required</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" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>Cancel or export any time</li>
</ul>
</div>
</div>
<div class="col-lg-7 p-4 p-sm-5">
<h1 class="wdw-heading h4 mb-1">Create your account</h1>
<p class="wdw-muted mb-4">Free forever. Takes less than a minute.</p>
<button type="button" class="btn btn-outline-secondary border-secondary-subtle text-body-emphasis bg-body rounded-pill w-100 google-btn" id="googleBtn">
<svg width="18" height="18" viewBox="0 0 48 48" aria-hidden="true"><path fill="#EA4335" d="M24 9.5c3.5 0 6.6 1.2 9.1 3.5l6.8-6.8C35.800 2.400 30.300 0 24 0 14.600 0 6.500 5.400 2.600 13.200l7.900 6.100C12.400 13.600 17.700 9.500 24 9.500z"/><path fill="#4285F4" d="M46.500 24.500c0-1.600-.1-3.100-.4-4.500H24v9h12.700c-.6 3-2.300 5.500-4.800 7.200l7.600 5.900c4.400-4.100 7-10.100 7-17.600z"/><path fill="#FBBC05" d="M10.500 28.700A14.500 14.500 0 0 1 9.500 24c0-1.600.3-3.200.8-4.700l-7.900-6.100A24 24 0 0 0 0 24c0 3.900.9 7.500 2.600 10.800l7.900-6.100z"/><path fill="#34A853" d="M24 48c6.500 0 11.900-2.100 15.900-5.800l-7.600-5.900c-2.100 1.400-4.900 2.300-8.300 2.300-6.300 0-11.600-4.100-13.500-9.800l-7.900 6.100C6.500 42.600 14.600 48 24 48z"/></svg>
Continue with Google
</button>
<div class="d-flex align-items-center gap-3 my-4 text-body-secondary small" role="separator">
<hr class="flex-grow-1 m-0"><span>or sign up with email</span><hr class="flex-grow-1 m-0">
</div>
<form id="signupForm" class="d-grid gap-3" novalidate>
<div class="form-floating">
<input type="text" class="form-control" id="suName" placeholder="Display name" autocomplete="name" required>
<label for="suName">Display name</label>
</div>
<div class="form-floating">
<input type="email" class="form-control" id="suEmail" placeholder="Email" autocomplete="email" required>
<label for="suEmail">Email address</label>
<div class="invalid-feedback">Enter a valid email address.</div>
</div>
<div>
<div class="input-group has-validation">
<div class="form-floating flex-grow-1">
<input type="password" class="form-control" id="suPass" placeholder="Password" autocomplete="new-password" minlength="8" aria-describedby="suHint" required>
<label for="suPass">Password</label>
</div>
<button type="button" class="btn btn-outline-secondary border-secondary-subtle text-body-secondary" id="suToggle" aria-label="Show password" aria-pressed="false">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
<div class="invalid-feedback">Use at least 8 characters.</div>
</div>
<div class="suMeterWrap d-none mt-2" id="suMeterWrap">
<div class="progress" style="height:4px" aria-hidden="true"><div class="progress-bar" id="suMeter" style="width:0"></div></div>
<div class="d-flex justify-content-between small mt-1"><span class="wdw-muted" id="suHint">8+ characters, mixed case, a number</span><span class="fw-semibold" id="suLabel"></span></div>
</div>
</div>
<div class="form-floating">
<input type="password" class="form-control" id="suPass2" placeholder="Repeat password" autocomplete="new-password" required>
<label for="suPass2">Repeat password</label>
<div class="invalid-feedback">Passwords do not match.</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="suTerms" required>
<label class="form-check-label small" for="suTerms">I agree to the <a href="#" class="fw-semibold text-decoration-none">Terms</a> and <a href="#" class="fw-semibold text-decoration-none">Privacy Policy</a></label>
<div class="invalid-feedback">Please accept the terms to continue.</div>
</div>
<button type="submit" class="btn btn-primary rounded-pill w-100">Create account</button>
<div class="alert alert-success d-none mb-0 rounded-4" id="suOk" role="status">Account created. Welcome aboard!</div>
</form>
<p class="text-center wdw-muted small mt-4 mb-0">Already have an account? <a href="#" class="fw-semibold text-decoration-none">Log in</a></p>
</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 */
.signup-brand { min-height: 100%; }
.google-btn:hover { background-color: var(--bs-tertiary-bg) !important; }
#suToggle { border-top-right-radius: .75rem; border-bottom-right-radius: .75rem; min-width: 48px; }
function initSignup() {
const form = document.getElementById('signupForm');
if (!form) return;
const pass = document.getElementById('suPass');
const pass2 = document.getElementById('suPass2');
const meter = document.getElementById('suMeter');
const wrap = document.getElementById('suMeterWrap');
const label = document.getElementById('suLabel');
const terms = document.getElementById('suTerms');
const ok = document.getElementById('suOk');
const toggle = document.getElementById('suToggle');
pass.addEventListener('input', function () {
const v = pass.value;
let score = 0;
if (v.length >= 8) score++;
if (/[A-Z]/.test(v) && /[a-z]/.test(v)) score++;
if (/\d/.test(v)) score++;
if (/[^A-Za-z0-9]/.test(v)) score++;
wrap.classList.toggle('d-none', !v);
meter.style.width = (v ? Math.max(1, score) * 25 : 0) + '%';
meter.className = 'progress-bar ' + (score <= 1 ? 'bg-danger' : score < 4 ? 'bg-warning' : 'bg-success');
label.textContent = score <= 1 ? 'Weak' : score < 4 ? 'Good' : 'Strong';
});
toggle.addEventListener('click', function () {
const show = pass.type === 'password';
pass.type = show ? 'text' : 'password';
toggle.setAttribute('aria-pressed', show);
toggle.setAttribute('aria-label', show ? 'Hide password' : 'Show password');
});
form.addEventListener('submit', function (e) {
e.preventDefault();
const email = document.getElementById('suEmail');
const checks = [
[email, email.validity.valid && email.value !== ''],
[pass, pass.value.length >= 8],
[pass2, pass2.value === pass.value && pass2.value !== ''],
[terms, terms.checked]
];
let valid = true;
checks.forEach(function (c) {
c[0].classList.toggle('is-invalid', !c[1]);
if (!c[1]) valid = false;
});
ok.classList.toggle('d-none', !valid);
});
const g = document.getElementById('googleBtn');
if (g) g.addEventListener('click', function () { ok.textContent = 'Google sign-up would start here.'; ok.classList.remove('d-none'); });
}
initSignup();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.