Snippets Form

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.

Bootstrap 5 No jQuery Nov 2020 2.2K views

<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>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.