Bootstrap 5 Sliding Sign In / Sign Up Form
A sign-in and sign-up card where a brand overlay slides across to swap between the two forms, with social buttons and floating labels. It stacks into a single column on small screens.
<section class="wdw-stage">
<div class="container" style="max-width:960px">
<div class="ds wdw-card" id="dsCard" data-mode="signin">
<div class="ds-form ds-signup" aria-hidden="true" inert>
<form class="ds-pane" novalidate>
<p class="small mb-3 d-md-none">Have an account? <a href="#" data-ds-go="signin">Sign in</a></p>
<h2 class="h3 wdw-heading mb-1">Create account</h2>
<p class="wdw-muted small mb-3">Free for 14 days, no card needed</p>
<div class="d-grid gap-2 mb-3">
<button type="button" class="btn btn-outline-secondary text-body-emphasis rounded-pill d-inline-flex align-items-center justify-content-center gap-2"><svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.56c2.08-1.92 3.28-4.74 3.28-8.1z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.56-2.77c-.98.66-2.23 1.06-3.72 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"/><path fill="#FBBC05" d="M5.84 14.1a6.6 6.6 0 0 1 0-4.2V7.07H2.18a11 11 0 0 0 0 9.86z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/></svg> Continue with Google</button>
<button type="button" class="btn btn-outline-secondary text-body-emphasis rounded-pill d-inline-flex align-items-center justify-content-center gap-2"><svg viewBox="0 0 24 24" width="18" height="18" 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.16.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.77 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.83 1.19 3.09 0 4.42-2.7 5.4-5.26 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> Continue with GitHub</button>
</div>
<div class="ds-or small wdw-muted mb-3"><span>or with email</span></div>
<div class="d-grid gap-2 mb-3">
<div class="form-floating"><input type="text" class="form-control" id="dsName" placeholder="Name" autocomplete="name" required><label for="dsName">Name</label><div class="invalid-feedback text-start">Please enter your name.</div></div>
<div class="form-floating"><input type="email" class="form-control" id="dsEmail2" placeholder="Email" autocomplete="email" required><label for="dsEmail2">Email</label><div class="invalid-feedback text-start">Enter a valid email address.</div></div>
<div class="ds-pw position-relative">
<div class="form-floating"><input type="password" class="form-control" id="dsPass2" placeholder="Password" autocomplete="new-password" required minlength="8"><label for="dsPass2">Password</label><div class="invalid-feedback text-start">Use at least 8 characters.</div></div>
<button type="button" class="ds-eye btn btn-link p-0" data-ds-eye="dsPass2" aria-label="Show password" aria-pressed="false"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" 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>
<p class="small wdw-muted text-start mb-0">At least 8 characters.</p>
</div>
<button type="submit" class="btn btn-primary rounded-pill w-100">Sign up</button>
<p class="small text-success-emphasis mt-3 mb-0" role="status"></p>
</form>
</div>
<div class="ds-form ds-signin">
<form class="ds-pane" novalidate>
<p class="small mb-3 d-md-none">No account? <a href="#" data-ds-go="signup">Sign up</a></p>
<h2 class="h3 wdw-heading mb-1">Sign in</h2>
<p class="wdw-muted small mb-3">Welcome back, we missed you</p>
<div class="d-grid gap-2 mb-3">
<button type="button" class="btn btn-outline-secondary text-body-emphasis rounded-pill d-inline-flex align-items-center justify-content-center gap-2"><svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.56c2.08-1.92 3.28-4.74 3.28-8.1z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.56-2.77c-.98.66-2.23 1.06-3.72 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"/><path fill="#FBBC05" d="M5.84 14.1a6.6 6.6 0 0 1 0-4.2V7.07H2.18a11 11 0 0 0 0 9.86z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/></svg> Continue with Google</button>
<button type="button" class="btn btn-outline-secondary text-body-emphasis rounded-pill d-inline-flex align-items-center justify-content-center gap-2"><svg viewBox="0 0 24 24" width="18" height="18" 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.16.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.77 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.83 1.19 3.09 0 4.42-2.7 5.4-5.26 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> Continue with GitHub</button>
</div>
<div class="ds-or small wdw-muted mb-3"><span>or with email</span></div>
<div class="d-grid gap-2 mb-2">
<div class="form-floating"><input type="email" class="form-control" id="dsEmail" placeholder="Email" autocomplete="email" required><label for="dsEmail">Email</label><div class="invalid-feedback text-start">Enter a valid email address.</div></div>
<div class="ds-pw position-relative">
<div class="form-floating"><input type="password" class="form-control" id="dsPass" placeholder="Password" autocomplete="current-password" required minlength="8"><label for="dsPass">Password</label><div class="invalid-feedback text-start">Use at least 8 characters.</div></div>
<button type="button" class="ds-eye btn btn-link p-0" data-ds-eye="dsPass" aria-label="Show password" aria-pressed="false"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" 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>
</div>
<a href="#" class="small d-inline-block mb-3">Forgot your password?</a>
<button type="submit" class="btn btn-primary rounded-pill w-100">Sign in</button>
<p class="small text-success-emphasis mt-3 mb-0" role="status"></p>
</form>
</div>
<div class="ds-overlay wdw-aurora d-none d-md-block">
<div class="ds-ov-pane ds-ov-left" inert>
<div class="ds-brand d-inline-flex align-items-center gap-2 mb-4"><svg viewBox="0 0 24 24" width="28" height="28" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2 3 7v10l9 5 9-5V7z"/><path d="M12 12 3 7M12 12l9-5M12 12v10"/></svg><span class="fw-bold">Northwind</span></div>
<p class="wdw-eyebrow text-white-50 mb-2">Already a member</p>
<p class="ds-ov-title fw-bolder mb-2">Welcome back!</p>
<p class="mb-3">Pick up right where you left off.</p>
<ul class="list-unstyled small text-start mb-4 d-grid gap-2"><li class="d-flex align-items-center gap-2"><svg viewBox="0 0 24 24" width="16" height="16" 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><span>Your projects, exactly as you left them</span></li><li class="d-flex align-items-center gap-2"><svg viewBox="0 0 24 24" width="16" height="16" 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><span>Team activity since your last visit</span></li></ul>
<button type="button" class="btn btn-light rounded-pill px-4" data-ds-go="signin">Sign in</button>
</div>
<div class="ds-ov-pane ds-ov-right">
<div class="ds-brand d-inline-flex align-items-center gap-2 mb-4"><svg viewBox="0 0 24 24" width="28" height="28" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2 3 7v10l9 5 9-5V7z"/><path d="M12 12 3 7M12 12l9-5M12 12v10"/></svg><span class="fw-bold">Northwind</span></div>
<p class="wdw-eyebrow text-white-50 mb-2">New here</p>
<p class="ds-ov-title fw-bolder mb-2">Start building today</p>
<p class="mb-3">Create an account in under a minute.</p>
<ul class="list-unstyled small text-start mb-4 d-grid gap-2"><li class="d-flex align-items-center gap-2"><svg viewBox="0 0 24 24" width="16" height="16" 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><span>Unlimited projects on the free plan</span></li><li class="d-flex align-items-center gap-2"><svg viewBox="0 0 24 24" width="16" height="16" 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><span>Invite your team at no cost</span></li><li class="d-flex align-items-center gap-2"><svg viewBox="0 0 24 24" width="16" height="16" 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><span>Cancel any time</span></li></ul>
<button type="button" class="btn btn-light rounded-pill px-4" data-ds-go="signup">Sign up</button>
</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 */
.ds { position: relative; overflow: hidden; min-height: 38rem; }
.ds-form { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; align-items: center; justify-content: center; transition: transform .6s cubic-bezier(.65,.05,.25,1), opacity .4s; }
.ds-pane { width: 100%; max-width: 20rem; padding: 1.5rem; text-align: center; }
.ds-signin { left: 0; z-index: 2; }
.ds-signup { left: 0; opacity: 0; z-index: 1; pointer-events: none; }
.ds[data-mode="signup"] .ds-signin { transform: translateX(100%); opacity: 0; pointer-events: none; }
.ds[data-mode="signup"] .ds-signup { transform: translateX(100%); opacity: 1; z-index: 5; pointer-events: auto; }
.ds-overlay { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; z-index: 10; overflow: hidden; transition: transform .6s cubic-bezier(.65,.05,.25,1); }
.ds[data-mode="signup"] .ds-overlay { transform: translateX(-100%); }
.ds-ov-pane { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2.5rem; transition: opacity .35s; }
.ds-ov-left { opacity: 0; pointer-events: none; }
.ds[data-mode="signup"] .ds-ov-left { opacity: 1; pointer-events: auto; transition-delay: .25s; }
.ds[data-mode="signup"] .ds-ov-right { opacity: 0; pointer-events: none; }
.ds-ov-pane p:not(.wdw-eyebrow) { max-width: 18rem; color: rgba(255,255,255,.88); }
.ds-ov-title { font-size: 2.1rem; line-height: 1.1; color: #fff; }
.ds-brand { color: #fff; }
.ds-ov-pane ul { max-width: 18rem; color: rgba(255,255,255,.92); }
.ds-or { display: flex; align-items: center; gap: .75rem; }
.ds-or::before, .ds-or::after { content: ""; flex: 1; height: 1px; background: var(--bs-border-color); }
.ds-eye { position: absolute; top: 0; right: 0; width: 3rem; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--bs-secondary-color); z-index: 4; }
.ds-pw .form-control { padding-right: 3rem; }
.ds-form[inert] .invalid-feedback { display: none; }
@media (max-width: 767.98px) {
.ds { min-height: 0; }
.ds-form { position: static; width: 100%; transform: none !important; opacity: 1 !important; }
.ds-form[inert] { display: none; }
.ds[data-mode="signup"] .ds-signin { display: none; }
.ds[data-mode="signup"] .ds-signup { display: flex; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { .ds-form, .ds-overlay, .ds-ov-pane { transition: none; } }
(function initDoubleSlider() {
const card = document.getElementById('dsCard');
if (!card) return;
function setMode(mode, moveFocus) {
card.dataset.mode = mode;
card.querySelectorAll('.ds-form').forEach(function (f) {
const active = f.classList.contains(mode === 'signup' ? 'ds-signup' : 'ds-signin');
f.inert = !active;
f.setAttribute('aria-hidden', String(!active));
});
card.querySelectorAll('.ds-ov-pane').forEach(function (p) {
p.inert = !p.classList.contains(mode === 'signup' ? 'ds-ov-left' : 'ds-ov-right');
});
if (moveFocus) {
const target = card.querySelector(mode === 'signup' ? '#dsName' : '#dsEmail');
setTimeout(function () { if (target) target.focus({ preventScroll: true }); }, 620);
}
}
card.querySelectorAll('[data-ds-go]').forEach(function (btn) {
btn.addEventListener('click', function (e) { e.preventDefault(); setMode(btn.dataset.dsGo, true); });
});
})();
(function initDoubleSliderForms() {
document.querySelectorAll('#dsCard form').forEach(function (f) {
f.addEventListener('submit', function (e) {
e.preventDefault();
f.classList.add('was-validated');
const status = f.querySelector('[role="status"]');
if (!f.checkValidity()) {
if (status) status.textContent = '';
const bad = f.querySelector(':invalid');
if (bad) bad.focus();
return;
}
if (status) status.textContent = 'Looks good. This is a demo form, nothing was sent.';
});
});
})();
(function initPasswordToggle() {
document.querySelectorAll('[data-ds-eye]').forEach(function (btn) {
btn.addEventListener('click', function () {
const input = document.getElementById(btn.dataset.dsEye);
if (!input) return;
const show = input.type === 'password';
input.type = show ? 'text' : 'password';
btn.setAttribute('aria-pressed', String(show));
btn.setAttribute('aria-label', show ? 'Hide password' : 'Show password');
});
});
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.