Snippets Form

Bootstrap 5 Login Form with Google and Facebook

A sign-in card with Google and Facebook buttons, email and password fields with a show-password toggle, remember me, and a branded side panel on larger screens.

Bootstrap 5 No jQuery Apr 2020 2.1K views

<section class="wdw-stage">
  <div class="container" style="max-width:920px">
    <div class="wdw-card overflow-hidden">
      <div class="row g-0">
        <div class="col-md-5 wdw-aurora p-4 p-lg-5 d-none d-md-flex flex-column justify-content-between">
          <span class="d-inline-flex align-items-center gap-2 fw-bold fs-5">
            <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m12 3 2.4 5.6L20 9l-4.2 3.9L17 19l-5-3-5 3 1.2-6.1L4 9l5.6-.4L12 3Z"/></svg>
            Northstar
          </span>
          <div class="my-4">
            <p class="h3 fw-bold lh-sm mb-3">Pick up right where you left off.</p>
            <p class="opacity-75 mb-0">Sign in to see your projects, teammates and everything that changed while you were away.</p>
          </div>
          <figure class="brand-quote mb-0 rounded-4 p-3">
            <blockquote class="small mb-3">“Northstar replaced three tools for our team. Mornings start with one tab now.”</blockquote>
            <figcaption class="d-flex align-items-center gap-2 small">
              <span class="d-flex">
                <img class="rounded-circle border border-2 border-white" width="32" height="32" src="https://i.pravatar.cc/64?img=47" alt="">
                <img class="rounded-circle border border-2 border-white ms-n2" width="32" height="32" src="https://i.pravatar.cc/64?img=12" alt="">
                <img class="rounded-circle border border-2 border-white ms-n2" width="32" height="32" src="https://i.pravatar.cc/64?img=32" alt="">
              </span>
              <span><strong class="d-block">Priya N.</strong><span class="opacity-75">Head of Ops, 2,400+ teams</span></span>
            </figcaption>
          </figure>
        </div>
        <div class="col-md-7 p-4 p-lg-5">
          <form id="login-form" novalidate>
            <h2 class="wdw-heading h3 mb-1">Welcome back</h2>
            <p class="wdw-muted mb-4">Log in to your account to continue.</p>

            <div class="row g-2 mb-3">
              <div class="col-6">
                <button type="button" class="btn btn-outline-secondary social rounded-pill w-100" data-social="Google">
                  <svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true"><path fill="#4285F4" d="M23.52 12.27c0-.85-.08-1.67-.22-2.45H12v4.64h6.46a5.52 5.52 0 0 1-2.4 3.62v3h3.88c2.27-2.09 3.58-5.17 3.58-8.81z"/><path fill="#34A853" d="M12 24c3.24 0 5.96-1.07 7.94-2.92l-3.88-3c-1.07.72-2.45 1.15-4.06 1.15-3.12 0-5.77-2.11-6.71-4.94H1.28v3.1A12 12 0 0 0 12 24z"/><path fill="#FBBC05" d="M5.29 14.29a7.2 7.2 0 0 1 0-4.58v-3.1H1.28a12 12 0 0 0 0 10.78l4.01-3.1z"/><path fill="#EA4335" d="M12 4.77c1.76 0 3.34.61 4.58 1.8l3.43-3.43C17.95 1.19 15.23 0 12 0A12 12 0 0 0 1.28 6.61l4.01 3.1C6.23 6.88 8.88 4.77 12 4.77z"/></svg>
                  Google
                </button>
              </div>
              <div class="col-6">
                <button type="button" class="btn btn-outline-secondary social rounded-pill w-100" data-social="Facebook">
                  <svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true"><path fill="#1877F2" d="M24 12a12 12 0 1 0-13.88 11.85v-8.38H7.08V12h3.04V9.36c0-3 1.79-4.67 4.53-4.67 1.31 0 2.69.23 2.69.23v2.95h-1.51c-1.49 0-1.96.93-1.96 1.88V12h3.33l-.53 3.47h-2.8v8.38A12 12 0 0 0 24 12z"/></svg>
                  Facebook
                </button>
              </div>
            </div>

            <div class="d-flex align-items-center gap-3 wdw-muted small text-uppercase fw-semibold my-3"><hr class="flex-grow-1 m-0"> or with email <hr class="flex-grow-1 m-0"></div>

            <div class="form-floating mb-3">
              <input type="email" class="form-control" id="login-email" placeholder="[email protected]" autocomplete="email" required aria-describedby="login-email-err">
              <label for="login-email">Email address</label>
              <div class="invalid-feedback" id="login-email-err">Enter a valid email address.</div>
            </div>
            <div class="form-floating pw mb-3">
              <input type="password" class="form-control" id="login-password" placeholder="Password" autocomplete="current-password" required minlength="6" aria-describedby="login-password-err">
              <label for="login-password">Password</label>
              <button type="button" class="btn btn-link pw-toggle text-body-secondary" id="pw-toggle" aria-label="Show password" aria-pressed="false">
                <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.500-7 10-7 10 7 10 7-3.500 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg>
              </button>
              <div class="invalid-feedback" id="login-password-err">Password must be at least 6 characters.</div>
            </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="remember">
                <label class="form-check-label" for="remember">Remember me</label>
              </div>
              <a href="#" class="fw-semibold small text-decoration-none">Forgot password?</a>
            </div>

            <div class="alert alert-success py-2 small d-none mb-3" role="status" data-login-status></div>
            <button type="submit" class="btn btn-primary btn-lg rounded-pill w-100">Log in</button>
            <p class="text-center wdw-muted mt-4 mb-0">Don't have an account? <a href="#" class="fw-semibold text-decoration-none">Sign up</a></p>
          </form>
        </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.