Snippets Signin

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.

Bootstrap 5 No jQuery Nov 2020 4.1K views

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

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.