Snippets Form

Bootstrap 5 Login Form Examples (3 Styles)

Three login card variations: email and password with remember-me, social sign-in options, and an icon-led secure form with a success message.

Bootstrap 5 No jQuery Jun 2019 13.9K views

<section class="lg-section wdw-stage"><div class="container">
<div class="row g-4 justify-content-center">
<div class="col-md-6 col-lg-4"><div class="card wdw-card border-0 h-100 lg-card overflow-hidden"><form class="card-body d-flex flex-column p-4 p-xl-5" novalidate onsubmit="return false"><div class="d-flex align-items-center gap-3 mb-4"><span class="wdw-icon" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c.6-4 4-6 8-6s7.400 2 8 6"/></svg></span><div><h2 class="h4 fw-bold mb-0 text-body-emphasis">Sign in</h2><p class="text-body-secondary small mb-0">Welcome back.</p></div></div><div class="mb-3"><div class="form-floating"><input type="email" class="form-control" id="lg1Email" placeholder="Email address" autocomplete="email"><label for="lg1Email">Email address</label></div></div><div class="input-group mb-3"><div class="form-floating"><input type="password" class="form-control" id="lg1Pass" placeholder="Password" autocomplete="current-password"><label for="lg1Pass">Password</label></div><button class="btn lg-eye" type="button" aria-label="Show password" aria-pressed="false" data-pw="#lg1Pass"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" 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><div class="d-flex justify-content-between align-items-center mb-4"><div class="form-check"><input class="form-check-input" type="checkbox" id="lg1Remember"><label class="form-check-label small" for="lg1Remember">Remember me</label></div><a href="#" class="small link-primary fw-medium">Forgot password?</a></div><button type="submit" class="btn btn-primary w-100 rounded-pill">Log in</button><div class="lg-or text-body-secondary small my-3"><span>or</span></div><div class="d-grid"><button type="button" class="btn btn-outline-secondary rounded-pill"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="15" r="4"/><path d="M11 12l9-9M16 7l3 3M14 9l2 2"/></svg> Sign in with SSO</button></div><div class="mt-auto"></div><p class="text-center text-body-secondary small mt-4 mb-0">No account? <a href="#" class="link-primary fw-medium">Sign up</a></p></form></div></div>
<div class="col-md-6 col-lg-4"><div class="card wdw-card border-0 h-100 lg-card overflow-hidden"><form class="card-body d-flex flex-column p-4 p-xl-5" novalidate onsubmit="return false"><div class="d-flex align-items-center gap-3 mb-4"><span class="wdw-icon" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l1.9 5.100L19 10l-5.100 1.900L12 17l-1.900-5.100L5 10l5.100-1.900z"/></svg></span><div><h2 class="h4 fw-bold mb-0 text-body-emphasis">Welcome</h2><p class="text-body-secondary small mb-0">Choose how to continue.</p></div></div><div class="d-grid gap-2"><button type="button" class="btn btn-outline-secondary rounded-pill"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 .5a11.500 11.500 0 0 0-3.600 22.400c.6.100.8-.3.8-.6v-2c-3.200.7-3.900-1.500-3.900-1.500-.5-1.300-1.300-1.700-1.300-1.700-1-.7.100-.7.100-.7 1.200.1 1.800 1.200 1.800 1.200 1 1.800 2.800 1.300 3.400 1 .1-.8.4-1.300.7-1.600-2.600-.3-5.300-1.300-5.300-5.700 0-1.300.5-2.300 1.200-3.100-.1-.3-.5-1.500.1-3.100 0 0 1-.3 3.200 1.200a11 11 0 0 1 5.800 0c2.200-1.500 3.200-1.200 3.200-1.200.6 1.600.2 2.800.1 3.100.8.800 1.200 1.800 1.200 3.100 0 4.400-2.700 5.400-5.300 5.700.4.400.8 1.100.8 2.200v3.200c0 .3.2.7.8.6A11.500 11.500 0 0 0 12 .5z"/></svg> Continue with GitHub</button><button type="button" class="btn btn-outline-secondary rounded-pill"><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="M21 12.200c0-.6-.1-1.200-.2-1.700H12v3.300h5.100a4.400 4.400 0 0 1-1.900 2.900v2.400h3.100c1.800-1.700 2.700-4.100 2.700-6.900z" stroke="none" fill="currentColor"/><path d="M20 4.500A10 10 0 1 0 22 12h-9"/></svg> Continue with Google</button></div><div class="lg-or text-body-secondary small my-3"><span>or</span></div><div class="mb-3"><div class="form-floating"><input type="email" class="form-control" id="lg2Email" placeholder="Email address" autocomplete="email"><label for="lg2Email">Email address</label></div></div><div class="mb-3"><div class="form-floating"><input type="password" class="form-control" id="lg2Pass" placeholder="Password" autocomplete="current-password"><label for="lg2Pass">Password</label></div></div><div class="d-flex justify-content-between align-items-center mb-4"><div class="form-check"><input class="form-check-input" type="checkbox" id="lg2Remember"><label class="form-check-label small" for="lg2Remember">Remember me</label></div><a href="#" class="small link-primary fw-medium">Forgot password?</a></div><div class="mt-auto"></div><button type="submit" class="btn btn-primary w-100 rounded-pill">Log in</button><p class="text-center text-body-secondary small mt-4 mb-0">No account? <a href="#" class="link-primary fw-medium">Sign up</a></p></form></div></div>
<div class="col-md-6 col-lg-4"><div class="card wdw-card border-0 h-100 lg-card overflow-hidden"><div class="wdw-aurora lg-band d-flex align-items-center gap-3 p-4 px-xl-5"><span class="lg-glass" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="11" width="16" height="10" rx="3"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></svg></span><div><h2 class="h4 fw-bold mb-0 text-white">Secure sign in</h2><p class="small mb-0 lg-band-sub">Your session is protected.</p></div></div><form class="card-body d-flex flex-column p-4 p-xl-5" novalidate onsubmit="return false"><div class="alert alert-success d-flex align-items-start gap-2 border-0 mb-3" role="status"><svg class="flex-none mt-1" 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"><circle cx="12" cy="12" r="10"/><path d="M8 12.500l2.800 2.800L16 9.500"/></svg><div><strong class="d-block">Password updated</strong><span class="small">Log in with your new password to continue.</span></div></div><div class="mb-3"><div class="form-floating"><input type="email" class="form-control" id="lg3Email" placeholder="Email address" autocomplete="email"><label for="lg3Email">Email address</label></div></div><div class="mb-3"><div class="form-floating"><input type="password" class="form-control" id="lg3Pass" placeholder="Password" autocomplete="current-password"><label for="lg3Pass">Password</label></div></div><div class="d-flex justify-content-between align-items-center mb-4"><div class="form-check"><input class="form-check-input" type="checkbox" id="lg3Remember"><label class="form-check-label small" for="lg3Remember">Remember me</label></div><a href="#" class="small link-primary fw-medium">Forgot password?</a></div><div class="mt-auto"></div><button type="submit" class="btn btn-primary w-100 rounded-pill">Log in</button><p class="text-center text-body-secondary small mt-4 mb-0">No account? <a href="#" class="link-primary fw-medium">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.