Bootstrap 5 Sign In / Sign Up Card with Tabs
A glass-style authentication card over a city photograph with a pill tab switcher between sign in and sign up, floating labels and a remember-me option.
<section class="wdw-stage position-relative overflow-hidden">
<img class="sa-bg" src="https://images.unsplash.com/photo-1449824913935-59a10b8d2000?auto=format&fit=crop&w=1600&q=70" alt="">
<div class="sa-scrim"></div>
<div class="container position-relative" style="max-width:480px">
<div class="sa-card rounded-5 overflow-hidden text-white" data-bs-theme="dark">
<div class="p-4 p-md-5">
<ul class="nav nav-pills sa-tabs mb-4 p-1 rounded-pill" id="saTabs" role="tablist">
<li class="nav-item flex-fill" role="presentation"><button class="nav-link rounded-pill w-100 active" id="sa-in-tab" data-bs-toggle="pill" data-bs-target="#sa-in" type="button" role="tab" aria-controls="sa-in" aria-selected="true">Sign in</button></li>
<li class="nav-item flex-fill" role="presentation"><button class="nav-link rounded-pill w-100" id="sa-up-tab" data-bs-toggle="pill" data-bs-target="#sa-up" type="button" role="tab" aria-controls="sa-up" aria-selected="false">Sign up</button></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="sa-in" role="tabpanel" aria-labelledby="sa-in-tab" tabindex="0">
<h1 class="h3 fw-bold mb-1">Welcome back</h1>
<p class="small opacity-75 mb-4">Sign in to pick up where you left off.</p>
<form onsubmit="return false">
<div class="d-flex gap-2 mb-3"><button type="button" class="btn btn-outline-light rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><path fill="#4285F4" d="M23.5 12.27c0-.85-.08-1.67-.22-2.45H12v4.64h6.45a5.51 5.51 0 0 1-2.39 3.62v3h3.87c2.27-2.09 3.57-5.17 3.57-8.81z"/><path fill="#34A853" d="M12 24c3.24 0 5.95-1.07 7.93-2.91l-3.87-3c-1.07.72-2.45 1.15-4.06 1.15-3.12 0-5.77-2.11-6.71-4.94H1.29v3.09A12 12 0 0 0 12 24z"/><path fill="#FBBC05" d="M5.29 14.3A7.2 7.2 0 0 1 4.91 12c0-.8.14-1.57.38-2.3V6.61H1.29A12 12 0 0 0 0 12c0 1.94.46 3.77 1.29 5.39l4-3.09z"/><path fill="#EA4335" d="M12 4.75c1.76 0 3.34.61 4.59 1.8l3.43-3.43C17.95 1.19 15.24 0 12 0A12 12 0 0 0 1.29 6.61l4 3.09C6.23 6.86 8.88 4.75 12 4.75z"/></svg> Google</button><button type="button" class="btn btn-outline-light rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56v-2c-3.2.7-3.88-1.37-3.88-1.37-.52-1.33-1.28-1.69-1.28-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.03 1.76 2.69 1.25 3.35.96.1-.74.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.78 0c2.2-1.49 3.17-1.18 3.17-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.39-5.25 5.68.41.36.78 1.06.78 2.14v3.17c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .5z"/></svg> GitHub</button></div><div class="d-flex align-items-center gap-2 small opacity-75 mb-3"><hr class="flex-fill m-0"><span>or</span><hr class="flex-fill m-0"></div>
<div class="form-floating mb-3"><input type="text" class="form-control" id="sa-i-user" placeholder="Username" required autocomplete="username"><label for="sa-i-user">Username</label></div>
<div class="input-group mb-3 sa-pw"><div class="form-floating"><input type="password" class="form-control" id="sa-i-pass" placeholder="Password" required autocomplete="current-password"><label for="sa-i-pass">Password</label></div><button class="btn btn-outline-light" type="button" data-sa-reveal="sa-i-pass" aria-label="Show password" aria-pressed="false">Show</button></div>
<div class="d-flex justify-content-between align-items-center mb-4">
<div class="form-check mb-0"><input class="form-check-input" type="checkbox" id="sa-keep" checked><label class="form-check-label small" for="sa-keep">Keep me signed in</label></div>
<a href="#" class="small text-white text-decoration-none fw-semibold">Forgot password?</a>
</div>
<button class="btn btn-primary rounded-pill w-100" type="submit">Sign in</button>
</form>
</div>
<div class="tab-pane fade" id="sa-up" role="tabpanel" aria-labelledby="sa-up-tab" tabindex="0">
<h2 class="h3 fw-bold mb-1">Create your account</h2>
<p class="small opacity-75 mb-4">Join in seconds. No credit card needed.</p>
<form onsubmit="return false">
<div class="d-flex gap-2 mb-3"><button type="button" class="btn btn-outline-light rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><path fill="#4285F4" d="M23.5 12.27c0-.85-.08-1.67-.22-2.45H12v4.64h6.45a5.51 5.51 0 0 1-2.39 3.62v3h3.87c2.27-2.09 3.57-5.17 3.57-8.81z"/><path fill="#34A853" d="M12 24c3.24 0 5.95-1.07 7.93-2.91l-3.87-3c-1.07.72-2.45 1.15-4.06 1.15-3.12 0-5.77-2.11-6.71-4.94H1.29v3.09A12 12 0 0 0 12 24z"/><path fill="#FBBC05" d="M5.29 14.3A7.2 7.2 0 0 1 4.91 12c0-.8.14-1.57.38-2.3V6.61H1.29A12 12 0 0 0 0 12c0 1.94.46 3.77 1.29 5.39l4-3.09z"/><path fill="#EA4335" d="M12 4.75c1.76 0 3.34.61 4.59 1.8l3.43-3.43C17.95 1.19 15.24 0 12 0A12 12 0 0 0 1.29 6.61l4 3.09C6.23 6.86 8.88 4.75 12 4.75z"/></svg> Google</button><button type="button" class="btn btn-outline-light rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56v-2c-3.2.7-3.88-1.37-3.88-1.37-.52-1.33-1.28-1.69-1.28-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.03 1.76 2.69 1.25 3.35.96.1-.74.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.78 0c2.2-1.49 3.17-1.18 3.17-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.39-5.25 5.68.41.36.78 1.06.78 2.14v3.17c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .5z"/></svg> GitHub</button></div><div class="d-flex align-items-center gap-2 small opacity-75 mb-3"><hr class="flex-fill m-0"><span>or</span><hr class="flex-fill m-0"></div>
<div class="form-floating mb-3"><input type="text" class="form-control" id="sa-u-user" placeholder="Username" required autocomplete="username"><label for="sa-u-user">Username</label></div>
<div class="form-floating mb-3"><input type="email" class="form-control" id="sa-u-mail" placeholder="Email" required autocomplete="email"><label for="sa-u-mail">Email</label></div>
<div class="input-group mb-3 sa-pw"><div class="form-floating"><input type="password" class="form-control" id="sa-u-pass" placeholder="Password" required autocomplete="new-password" minlength="8"><label for="sa-u-pass">Password</label></div><button class="btn btn-outline-light" type="button" data-sa-reveal="sa-u-pass" aria-label="Show password" aria-pressed="false">Show</button></div>
<button class="btn btn-primary rounded-pill w-100 mt-2" type="submit">Sign up</button>
</form>
</div>
</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 */
.sa-card { background: rgba(20,18,50,.42); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 24px 60px -20px rgba(0,0,0,.6); }
.sa-bg { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sa-scrim { position: absolute; z-index: 0; inset: 0; background: linear-gradient(160deg, rgba(30,27,75,.35), rgba(30,27,75,.6)); }
.sa-tabs { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.sa-card .nav-link { --bs-nav-link-color: rgba(255,255,255,.75); --bs-nav-link-hover-color: #fff; font-weight: 600; min-height: 40px; }
.sa-card .nav-link.active { background: #fff; color: #3730a3; }
.sa-card .form-control { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.sa-card .form-control:focus { background: rgba(255,255,255,.18); border-color: #fff; color: #fff; }
.sa-card .form-floating > label { color: rgba(255,255,255,.75); }
.sa-card .form-floating > .form-control:focus ~ label,
.sa-card .form-floating > .form-control:not(:placeholder-shown) ~ label { color: rgba(255,255,255,.85); }
.sa-card .form-floating > .form-control:focus ~ label::after,
.sa-card .form-floating > .form-control:not(:placeholder-shown) ~ label::after { background: transparent; }
.sa-card .form-check-input { background-color: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
.sa-card .form-check-input:checked { background-color: #fff; border-color: #fff; --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%234f46e5' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.sa-card .btn-primary { --bs-btn-bg: #fff; --bs-btn-color: #3730a3; --bs-btn-border-color: #fff; --bs-btn-hover-bg: #e0e7ff; --bs-btn-hover-color: #312e81; --bs-btn-hover-border-color: #e0e7ff; --bs-btn-active-bg: #c7d2fe; --bs-btn-active-color: #312e81; }
.sa-card .tab-pane { min-height: 340px; }
.sa-pw .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.sa-pw .btn { border-color: rgba(255,255,255,.25); min-width: 4.5rem; border-top-right-radius: .75rem; border-bottom-right-radius: .75rem; }
.sa-card .btn-outline-light { --bs-btn-border-color: rgba(255,255,255,.35); }
.sa-card .btn-primary { box-shadow: 0 6px 18px -6px rgba(0,0,0,.5); }
(function () {
function initAuthTabs() {
var tabs = document.getElementById('saTabs');
if (!tabs) return;
tabs.addEventListener('shown.bs.tab', function (e) {
var pane = document.querySelector(e.target.dataset.bsTarget);
var field = pane && pane.querySelector('input');
if (field) field.focus({ preventScroll: true });
});
}
function initReveal() {
document.querySelectorAll('[data-sa-reveal]').forEach(function (btn) {
var input = document.getElementById(btn.dataset.saReveal);
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);
});
});
}
initAuthTabs();
initReveal();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.