Snippets Form

Bootstrap 5 Login and Sign Up Form with Tabs

A combined sign-in and registration card with pill tabs, a brand panel whose message changes with the tab, password reveal and social sign-in buttons.

Bootstrap 5 No jQuery Nov 2020 4.7K views

<section class="lg-section wdw-stage">
  <div class="container" style="max-width:960px">
    <div class="wdw-card overflow-hidden">
      <div class="row g-0">
        <div class="col-md-5 lg-brand wdw-aurora p-4 p-lg-5 d-flex flex-column justify-content-between">
          <div class="d-flex align-items-center gap-2 fw-bold"><span class="lg-mark rounded-3 d-inline-flex align-items-center justify-content-center" aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12 5 5L20 7"/></svg></span>Tasklane</div>
          <div class="my-4">
            <h2 class="display-6 fw-bold mb-3" id="lgHeadline">Welcome back</h2>
            <p class="mb-0" id="lgCopy" style="color:rgba(255,255,255,.85)">Sign in to pick up right where you left off.</p>
            <ul class="list-unstyled small d-grid gap-2 mt-4 mb-0" style="color:rgba(255,255,255,.9)">
              <li class="d-flex gap-2 align-items-center"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12 5 5L20 7"/></svg>Unlimited boards and projects</li>
              <li class="d-flex gap-2 align-items-center"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12 5 5L20 7"/></svg>Sprint planning and reports</li>
              <li class="d-flex gap-2 align-items-center"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12 5 5L20 7"/></svg>Integrations with the tools you use</li>
            </ul>
          </div>
          <figure class="lg-quote rounded-4 p-3 mb-0">
            <blockquote class="mb-3 text-white">"We moved our whole sprint process into Tasklane in an afternoon."</blockquote>
            <figcaption class="d-flex align-items-center gap-2 small"><img src="https://i.pravatar.cc/64?img=12" width="32" height="32" class="rounded-circle" alt=""><span class="lh-sm"><span class="fw-semibold d-block">Daniel Ortiz</span><span class="d-block" style="color:rgba(255,255,255,.8)">Product lead, Fieldly</span></span></figcaption>
          </figure>
        </div>
        <div class="col-md-7 p-4 p-lg-5 bg-body">
          <ul class="nav nav-pills nav-fill bg-body-tertiary border rounded-pill p-1 mb-4" id="lgTabs" role="tablist">
            <li class="nav-item" role="presentation"><button class="nav-link active rounded-pill" id="lg-in-tab" data-bs-toggle="pill" data-bs-target="#lg-in" type="button" role="tab" aria-controls="lg-in" aria-selected="true" data-headline="Welcome back" data-copy="Sign in to pick up right where you left off.">Sign in</button></li>
            <li class="nav-item" role="presentation"><button class="nav-link rounded-pill" id="lg-up-tab" data-bs-toggle="pill" data-bs-target="#lg-up" type="button" role="tab" aria-controls="lg-up" aria-selected="false" data-headline="Create your account" data-copy="Free for 14 days. No credit card required.">Create account</button></li>
          </ul>
          <div class="tab-content">
            <div class="tab-pane fade show active" id="lg-in" role="tabpanel" aria-labelledby="lg-in-tab" tabindex="0">
              <form class="lg-form" novalidate>
                <div class="form-floating mb-3"><input type="email" class="form-control rounded-3" id="lgEmail" placeholder="Email" required><label for="lgEmail">Email address</label></div>
                <div class="form-floating position-relative mb-3 lg-pw"><input type="password" class="form-control rounded-3" id="lgPass" placeholder="Password" required><label for="lgPass">Password</label><button class="lg-toggle btn btn-link text-body-secondary p-0" type="button" data-lg-toggle="#lgPass" aria-label="Show password"><svg class="lg-eye" width="20" height="20" 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.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg><svg class="lg-eye-off d-none" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17.9 17.9A10.4 10.4 0 0 1 12 19C5.6 19 2 12 2 12a18 18 0 0 1 4.1-5M9.9 5.2A9.7 9.7 0 0 1 12 5c6.4 0 10 7 10 7a18 18 0 0 1-2.2 3.2M1 1l22 22M9.9 9.9a3 3 0 0 0 4.2 4.2"/></svg></button></div>
                <div class="d-flex justify-content-between align-items-center mb-4">
                  <div class="form-check lg-check"><input class="form-check-input" type="checkbox" id="lgRemember"><label class="form-check-label" for="lgRemember">Remember me</label></div>
                  <a href="#" class="small link-underline-opacity-0 link-underline-opacity-100-hover">Forgot password?</a>
                </div>
                <button type="submit" class="btn btn-primary w-100 rounded-pill">Sign in</button>
              </form>
            </div>
            <div class="tab-pane fade" id="lg-up" role="tabpanel" aria-labelledby="lg-up-tab" tabindex="0">
              <form class="lg-form" novalidate>
                <div class="form-floating mb-3"><input type="text" class="form-control rounded-3" id="lgName" placeholder="Name" required><label for="lgName">Full name</label></div>
                <div class="form-floating mb-3"><input type="email" class="form-control rounded-3" id="lgEmail2" placeholder="Email" required><label for="lgEmail2">Email address</label></div>
                <div class="form-floating position-relative mb-3 lg-pw"><input type="password" class="form-control rounded-3" id="lgPass2" placeholder="Password" minlength="8" required><label for="lgPass2">Password (8+ characters)</label><button class="lg-toggle btn btn-link text-body-secondary p-0" type="button" data-lg-toggle="#lgPass2" aria-label="Show password"><svg class="lg-eye" width="20" height="20" 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.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg><svg class="lg-eye-off d-none" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17.9 17.9A10.4 10.4 0 0 1 12 19C5.6 19 2 12 2 12a18 18 0 0 1 4.1-5M9.9 5.2A9.7 9.7 0 0 1 12 5c6.4 0 10 7 10 7a18 18 0 0 1-2.2 3.2M1 1l22 22M9.9 9.9a3 3 0 0 0 4.2 4.2"/></svg></button></div>
                <div class="form-check lg-check mb-4"><input class="form-check-input" type="checkbox" id="lgTerms" required><label class="form-check-label" for="lgTerms">I agree to the Terms and Privacy Policy</label></div>
                <button type="submit" class="btn btn-primary w-100 rounded-pill">Create account</button>
              </form>
            </div>
          </div>
          <div class="d-flex align-items-center gap-3 text-body-secondary small my-4"><hr class="flex-grow-1 m-0"><span>or continue with</span><hr class="flex-grow-1 m-0"></div>
          <div class="row g-2">
            <div class="col-6"><button type="button" class="btn lg-social w-100 rounded-3 py-2"><svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" d="M19.2 7.2A8.5 8.5 0 1 0 20.5 12H12"/></svg>Google</button></div>
            <div class="col-6"><button type="button" class="btn lg-social w-100 rounded-3 py-2"><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.6 22.4c.6.1.8-.3.8-.6v-2c-3.2.7-3.9-1.5-3.9-1.5-.5-1.3-1.3-1.7-1.3-1.7-1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1 1.8 2.8 1.3 3.4 1 .1-.8.4-1.3.7-1.6-2.6-.3-5.3-1.3-5.3-5.7 0-1.3.5-2.3 1.2-3.1-.1-.3-.5-1.5.1-3.1 0 0 1-.3 3.2 1.2a11 11 0 0 1 5.8 0c2.2-1.5 3.2-1.2 3.2-1.2.6 1.6.2 2.8.1 3.1.8.8 1.2 1.9 1.2 3.1 0 4.4-2.7 5.4-5.3 5.7.4.4.8 1.1.8 2.2v3.2c0 .3.2.7.8.6A11.5 11.5 0 0 0 12 .5z"/></svg>GitHub</button></div>
          </div>
          <p class="small text-success text-center mt-3 mb-0 d-none" id="lgOk" role="status">Success! Redirecting to your dashboard...</p>
        </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.