Bootstrap 5 Sign In / Sign Up Form with Sliding Panel
A sign in and sign up card where a gradient panel slides across to reveal the other form, with social buttons and floating-label inputs. On small screens it collapses to one form with a text link to switch.
<section class="wdw-stage">
<div class="container" style="max-width:900px">
<div class="ss wdw-card overflow-hidden position-relative" id="ss">
<div class="row g-0 ss-forms">
<div class="col-md-6 ss-pane ss-in" id="ss-in">
<form class="p-4 p-lg-5" onsubmit="return false">
<div class="nav nav-pills p-1 rounded-pill bg-body-tertiary border mb-4 ss-toggle" role="group" aria-label="Choose form"><button type="button" class="nav-link rounded-pill flex-fill ss-go active" data-go="in" aria-pressed="true">Sign in</button><button type="button" class="nav-link rounded-pill flex-fill ss-go " data-go="up" aria-pressed="false">Sign up</button></div>
<h1 class="h3 fw-bold mb-1">Sign in</h1>
<p class="wdw-muted small mb-4">Welcome back, we missed you.</p>
<div class="d-flex gap-2 mb-3"><button type="button" class="btn border bg-body-tertiary text-body-emphasis 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 border bg-body-tertiary text-body-emphasis 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 wdw-muted mb-3"><hr class="flex-fill m-0"><span>or with email</span><hr class="flex-fill m-0"></div>
<div class="form-floating mb-3"><input type="email" class="form-control" id="ss-i-mail" placeholder="Email" required autocomplete="email"><label for="ss-i-mail">Email</label></div>
<div class="form-floating mb-3"><input type="password" class="form-control" id="ss-i-pass" placeholder="Password" required autocomplete="current-password"><label for="ss-i-pass">Password</label></div>
<div class="text-end mb-3"><a href="#" class="small fw-semibold text-decoration-none">Forgot your password?</a></div>
<button class="btn btn-primary rounded-pill w-100" type="submit">Sign in</button>
</form>
</div>
<div class="col-md-6 ss-pane ss-up" id="ss-up">
<form class="p-4 p-lg-5" onsubmit="return false">
<div class="nav nav-pills p-1 rounded-pill bg-body-tertiary border mb-4 ss-toggle" role="group" aria-label="Choose form"><button type="button" class="nav-link rounded-pill flex-fill ss-go " data-go="in" aria-pressed="false">Sign in</button><button type="button" class="nav-link rounded-pill flex-fill ss-go active" data-go="up" aria-pressed="true">Sign up</button></div>
<h2 class="h3 fw-bold mb-1">Create account</h2>
<p class="wdw-muted small mb-4">Free for 14 days, no card required.</p>
<div class="d-flex gap-2 mb-3"><button type="button" class="btn border bg-body-tertiary text-body-emphasis 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 border bg-body-tertiary text-body-emphasis 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 wdw-muted mb-3"><hr class="flex-fill m-0"><span>or with email</span><hr class="flex-fill m-0"></div>
<div class="form-floating mb-3"><input type="text" class="form-control" id="ss-u-name" placeholder="Username" required autocomplete="username"><label for="ss-u-name">Username</label></div>
<div class="form-floating mb-3"><input type="email" class="form-control" id="ss-u-mail" placeholder="Email" required autocomplete="email"><label for="ss-u-mail">Email</label></div>
<div class="form-floating mb-3"><input type="password" class="form-control" id="ss-u-pass" placeholder="Password" required autocomplete="new-password" minlength="8"><label for="ss-u-pass">Password</label></div>
<button class="btn btn-primary rounded-pill w-100" type="submit">Sign up</button>
</form>
</div>
</div>
<div class="ss-overlay wdw-aurora d-none d-md-flex" aria-hidden="true">
<div class="ss-ov ss-ov-in px-4 px-lg-5">
<span class="fw-bold d-inline-flex align-items-center gap-2 mb-auto"><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="opacity-75 mb-3">New here? Create an account in under a minute.</p>
<ul class="list-unstyled small d-grid gap-2 mb-0"><li>✓ Unlimited projects</li><li>✓ Real-time team sharing</li><li>✓ Cancel anytime</li></ul>
</div>
<figure class="ss-quote rounded-4 p-3 mb-0 mt-auto">
<blockquote class="small mb-3">“Our whole team moved over in an afternoon.”</blockquote>
<figcaption class="d-flex align-items-center gap-2"><span class="d-flex"><img src="https://i.pravatar.cc/80?img=47" width="32" height="32" class="rounded-circle border border-2 border-white" alt=""><img src="https://i.pravatar.cc/80?img=12" width="32" height="32" class="rounded-circle border border-2 border-white" alt="" style="margin-left:-10px"><img src="https://i.pravatar.cc/80?img=32" width="32" height="32" class="rounded-circle border border-2 border-white" alt="" style="margin-left:-10px"></span><span class="small opacity-75">Loved by 40,000 designers</span></figcaption>
</figure>
</div>
<div class="ss-ov ss-ov-up px-4 px-lg-5">
<span class="fw-bold d-inline-flex align-items-center gap-2 mb-auto"><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">Good to see you again.</h2>
<p class="opacity-75 mb-3">Pick up right where you left off.</p>
<ul class="list-unstyled small d-grid gap-2 mb-0"><li>✓ Unlimited projects</li><li>✓ Real-time team sharing</li><li>✓ Cancel anytime</li></ul>
</div>
<figure class="ss-quote rounded-4 p-3 mb-0 mt-auto">
<blockquote class="small mb-3">“Our whole team moved over in an afternoon.”</blockquote>
<figcaption class="d-flex align-items-center gap-2"><span class="d-flex"><img src="https://i.pravatar.cc/80?img=47" width="32" height="32" class="rounded-circle border border-2 border-white" alt=""><img src="https://i.pravatar.cc/80?img=12" width="32" height="32" class="rounded-circle border border-2 border-white" alt="" style="margin-left:-10px"><img src="https://i.pravatar.cc/80?img=32" width="32" height="32" class="rounded-circle border border-2 border-white" alt="" style="margin-left:-10px"></span><span class="small opacity-75">Loved by 40,000 designers</span></figcaption>
</figure>
</div>
</div>
<p class="visually-hidden" role="status" aria-live="polite" id="ss-status"></p>
</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 */
.ss-overlay { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; z-index: 2; overflow: hidden; transition: transform .6s cubic-bezier(.65,0,.35,1); }
.ss.is-up .ss-overlay { transform: translateX(-100%); }
.ss-ov { position: absolute; inset: 0; display: flex; flex-direction: column; padding-block: 2.5rem; transition: opacity .35s ease .15s; }
.ss-ov-up { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.ss.is-up .ss-ov-in { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.ss.is-up .ss-ov-up { opacity: 1; visibility: visible; transition: opacity .35s ease .3s; }
.ss-pane { transition: opacity .4s ease; }
@media (min-width: 768px) {
.ss-forms { min-height: 520px; }
.ss.is-up .ss-in { opacity: 0; pointer-events: none; visibility: hidden; }
.ss:not(.is-up) .ss-up { opacity: 0; pointer-events: none; visibility: hidden; }
}
@media (max-width: 767.98px) {
.ss:not(.is-up) .ss-up, .ss.is-up .ss-in { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ss-overlay, .ss-ov, .ss-pane { transition: none; } }
.ss-quote { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.ss-toggle { --bs-nav-pills-link-active-color: #fff; }
[data-bs-theme="dark"] .ss-toggle .nav-link.active { color: #0f1117; }
@media (max-width: 767.98px) { .ss-toggle { max-width: 100%; } }
(function () {
function initSignInUp() {
var root = document.getElementById('ss');
if (!root) return;
var panes = { in: document.getElementById('ss-in'), up: document.getElementById('ss-up') };
var status = document.getElementById('ss-status');
function sync(up) {
root.classList.toggle('is-up', up);
panes.in.inert = up;
panes.up.inert = !up;
panes.in.setAttribute('aria-hidden', up);
panes.up.setAttribute('aria-hidden', !up);
if (status) status.textContent = up ? 'Sign up form shown' : 'Sign in form shown';
}
root.addEventListener('click', function (e) {
var b = e.target.closest('.ss-go');
if (!b) return;
var up = b.dataset.go === 'up';
if (root.classList.contains('is-up') === up) return;
sync(up);
var f = root.querySelector(up ? '#ss-u-name' : '#ss-i-mail');
if (f) setTimeout(function () { f.focus({ preventScroll: true }); }, 350);
});
root.addEventListener('keydown', function (e) {
if (e.key === 'Escape' && root.classList.contains('is-up')) {
sync(false);
root.querySelector('#ss-i-mail').focus({ preventScroll: true });
}
});
sync(false);
}
initSignInUp();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.