Snippets Login

Bootstrap 5 Login Page (3 Modern Layouts)

Three login page layouts: a split panel with a brand side, a centred card with a password-reset note, and a card with a gradient header. Each has icon-led fields, remember me and a forgot-password link.

Bootstrap 5 No jQuery Nov 2020 2.8K views

<section class="wdw-stage">
  <div class="container" style="max-width:960px">
    <div class="d-flex justify-content-center mb-4">
      <ul class="nav nav-pills lg-seg rounded-pill p-1" role="tablist" aria-label="Login layout">
        <li class="nav-item" role="presentation"><button class="nav-link rounded-pill px-4 active" data-bs-toggle="pill" data-bs-target="#lg0" type="button" role="tab" aria-selected="true">Split</button></li>
        <li class="nav-item" role="presentation"><button class="nav-link rounded-pill px-4" data-bs-toggle="pill" data-bs-target="#lg1" type="button" role="tab" aria-selected="false">Centered</button></li>
        <li class="nav-item" role="presentation"><button class="nav-link rounded-pill px-4" data-bs-toggle="pill" data-bs-target="#lg2" type="button" role="tab" aria-selected="false">Banner</button></li>
      </ul>
    </div>
    <div class="tab-content">
      <div class="tab-pane fade show active" id="lg0" role="tabpanel">
        <div class="wdw-card overflow-hidden"><div class="row g-0">
          <div class="col-md-6 wdw-aurora p-4 p-md-5 d-flex flex-column justify-content-between lg-side">
            <span class="small fw-semibold text-uppercase opacity-75" style="letter-spacing:.08em">What will you build today?</span>
            <div><h2 class="display-6 fw-bold mb-3" style="letter-spacing:-.02em">Let’s get started.</h2><p class="opacity-75 mb-0">Sign in to open your workspace, pick up recent projects and invite your team.</p></div>
          </div>
          <div class="col-md-6 p-4 p-md-5"><div class="mx-auto" style="max-width:340px">
            <h1 class="wdw-heading h3 mb-1">Sign in</h1><p class="wdw-muted mb-4">Need an account? <a href="#" class="fw-semibold text-decoration-none">Sign up</a></p>
            <form class="d-grid gap-3" onsubmit="return false"><div><label class="form-label small fw-semibold" for="a-u">Email or username</label><div class="input-group"><span class="input-group-text bg-transparent text-body-secondary lg-ico"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg></span><input type="text" class="form-control lg-in" id="a-u" placeholder="[email protected]" autocomplete="username"></div></div><div><label class="form-label small fw-semibold" for="a-p">Password</label><div class="input-group"><span class="input-group-text bg-transparent text-body-secondary lg-ico"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></span><input type="password" class="form-control lg-in" id="a-p" placeholder="Enter your password" autocomplete="current-password"></div></div><div class="d-flex justify-content-between align-items-center"><div class="form-check"><input class="form-check-input" type="checkbox" id="a-rm"><label class="form-check-label small" for="a-rm">Remember me</label></div><a href="#" class="small fw-semibold text-decoration-none">Forgot password?</a></div><button class="btn btn-primary rounded-pill w-100" type="submit">Sign in</button></form>
          </div></div>
        </div></div>
      </div>
      <div class="tab-pane fade" id="lg1" role="tabpanel">
        <div class="wdw-card mx-auto p-4 p-md-5" style="max-width:440px">
          <div class="text-center mb-4"><span class="wdw-icon mb-3" style="width:3.5rem;height:3.5rem;border-radius:1.1rem"><svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg></span>
          <h1 class="wdw-heading h3 mb-1">Login to your account</h1><p class="wdw-muted mb-0">Welcome back. Enter your details below.</p></div>
          <form class="d-grid gap-3" onsubmit="return false"><div><label class="form-label small fw-semibold" for="b-u">Email or username</label><div class="input-group"><span class="input-group-text bg-transparent text-body-secondary lg-ico"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg></span><input type="text" class="form-control lg-in" id="b-u" placeholder="[email protected]" autocomplete="username"></div></div><div><label class="form-label small fw-semibold" for="b-p">Password</label><div class="input-group"><span class="input-group-text bg-transparent text-body-secondary lg-ico"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></span><input type="password" class="form-control lg-in" id="b-p" placeholder="Enter your password" autocomplete="current-password"></div></div><div class="d-flex justify-content-between align-items-center"><div class="form-check"><input class="form-check-input" type="checkbox" id="b-rm"><label class="form-check-label small" for="b-rm">Remember me</label></div><a href="#" class="small fw-semibold text-decoration-none">Forgot password?</a></div><button class="btn btn-primary rounded-pill w-100" type="submit">Sign in</button></form>
          <hr class="my-4"><div class="rounded-4 bg-body-tertiary p-3"><div class="fw-bold text-body-emphasis mb-1">Forgot password?</div><p class="small wdw-muted mb-0">No problem, <a href="#" class="fw-semibold text-decoration-none">click here</a> to get a new password.</p></div>
        </div>
      </div>
      <div class="tab-pane fade" id="lg2" role="tabpanel">
        <div class="wdw-card overflow-hidden mx-auto" style="max-width:440px">
          <div class="wdw-aurora text-center py-4 px-4"><h1 class="h3 fw-bold mb-1">Welcome back</h1><p class="small opacity-75 mb-0">Log in to continue</p></div>
          <div class="p-4 p-md-5"><form class="d-grid gap-3" onsubmit="return false"><div><label class="form-label small fw-semibold" for="c-u">Email or username</label><div class="input-group"><span class="input-group-text bg-transparent text-body-secondary lg-ico"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg></span><input type="text" class="form-control lg-in" id="c-u" placeholder="[email protected]" autocomplete="username"></div></div><div><label class="form-label small fw-semibold" for="c-p">Password</label><div class="input-group"><span class="input-group-text bg-transparent text-body-secondary lg-ico"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></span><input type="password" class="form-control lg-in" id="c-p" placeholder="Enter your password" autocomplete="current-password"></div></div><div class="d-flex justify-content-between align-items-center"><div class="form-check"><input class="form-check-input" type="checkbox" id="c-rm"><label class="form-check-label small" for="c-rm">Remember me</label></div><a href="#" class="small fw-semibold text-decoration-none">Forgot password?</a></div><button class="btn btn-primary rounded-pill w-100" type="submit">Sign in</button></form><p class="text-center small wdw-muted mt-4 mb-0">New here? <a href="#" class="fw-semibold text-decoration-none">Create an account</a></p></div>
        </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.