Login split screen
A two-column sign-in page: a brand panel with a quote beside the form, stacking on small screens.
Installation
Usage
Use it as the content of the sign-in page's <main> element. From 768px the brand panel and the form sit side by side at full height; on phones the panel shrinks to the logo above the form.
Replace the logo, the quote and its author with your own.
Accessibility
- The heading is an
<h1>because the block is the page; keep one<h1>per page. - The quote uses
<figure>,<blockquote>and<figcaption>, so the author is tied to the quote. - The brand panel inverts the page colours (
--bs-emphasis-coloron--bs-body-bg), which keeps the contrast in light and dark mode.
Dependencies
- Bootstrap 5.3+ CSS.
themes/tokens/tokens.css.- The
inputcomponent. - The
checkboxcomponent. - The
buttoncomponent.
Source
The exact files the CLI installs (login-split@1.0.0). View on GitHub · Report an issue
html
<section class="bootcn-login-split" aria-labelledby="bootcn-login-split-title">
<div class="bootcn-login-split__aside">
<a class="bootcn-login-split__brand" href="#">
<svg
class="bootcn-icon"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
focusable="false"
>
<rect x="3" y="3" width="8" height="8" rx="2" />
<rect x="13" y="13" width="8" height="8" rx="2" />
<path d="M13 7h8M17 3v8M3 17h8" />
</svg>
Acme
</a>
<figure class="bootcn-login-split__quote">
<blockquote>
<p>“We moved our admin area to plain PHP and shipped it in a week.”</p>
</blockquote>
<figcaption>Eleni Kosta, CTO at Acme</figcaption>
</figure>
</div>
<div class="bootcn-login-split__main">
<div class="bootcn-login-split__panel">
<h1 class="bootcn-login-split__title" id="bootcn-login-split-title">Welcome back</h1>
<p class="bootcn-login-split__description">Sign in to continue to your workspace.</p>
<form class="bootcn-login-split__form" action="#" method="post">
<div class="bootcn-field">
<label for="bootcn-login-split-email" class="form-label bootcn-field__label">Email</label>
<input
type="email"
class="form-control bootcn-input"
id="bootcn-login-split-email"
name="email"
autocomplete="email"
placeholder="you@example.com"
required
/>
</div>
<div class="bootcn-field">
<div class="bootcn-login-split__label-row">
<label for="bootcn-login-split-password" class="form-label bootcn-field__label"
>Password</label
>
<a class="bootcn-login-split__link" href="#forgot-password">Forgot password?</a>
</div>
<input
type="password"
class="form-control bootcn-input"
id="bootcn-login-split-password"
name="password"
autocomplete="current-password"
required
/>
</div>
<div class="form-check bootcn-checkbox">
<input
class="form-check-input bootcn-checkbox__input"
type="checkbox"
id="bootcn-login-split-remember"
name="remember"
/>
<label class="form-check-label bootcn-checkbox__label" for="bootcn-login-split-remember"
>Keep me signed in</label
>
</div>
<button type="submit" class="btn bootcn-button bootcn-button--default w-100">
Sign in
</button>
</form>
<p class="bootcn-login-split__footer">
No account yet? <a class="bootcn-login-split__link" href="#sign-up">Create one</a>
</p>
</div>
</div>
</section>css
/* Two columns from 768px; the brand panel inverts the page colors, so it
contrasts in light and dark mode. */
.bootcn-login-split {
display: grid;
min-height: 36rem;
}
@media (min-width: 768px) {
.bootcn-login-split {
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
min-height: 100vh;
}
}
.bootcn-login-split__aside {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 2rem;
padding: 2rem;
background-color: var(--bs-emphasis-color);
color: var(--bs-body-bg);
}
.bootcn-login-split__brand {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: inherit;
font-weight: 600;
font-size: 1.125rem;
text-decoration: none;
}
.bootcn-login-split__brand .bootcn-icon {
width: 1.5rem;
height: 1.5rem;
}
.bootcn-login-split__quote {
margin: 0;
}
.bootcn-login-split__quote blockquote p {
margin: 0 0 0.75rem;
font-size: 1.25rem;
line-height: 1.5;
}
.bootcn-login-split__quote figcaption {
font-size: 0.875rem;
opacity: 0.85;
}
@media (max-width: 767.98px) {
.bootcn-login-split__quote {
display: none;
}
}
.bootcn-login-split__main {
display: flex;
align-items: center;
justify-content: center;
padding: 2rem 1rem;
}
.bootcn-login-split__panel {
width: 100%;
max-width: 22rem;
}
.bootcn-login-split__title {
margin: 0 0 0.25rem;
font-size: 1.5rem;
font-weight: 600;
}
.bootcn-login-split__description {
margin: 0 0 1.5rem;
color: var(--bs-secondary-color);
}
.bootcn-login-split__form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.bootcn-login-split__form .bootcn-field {
margin: 0;
}
.bootcn-login-split__label-row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 1rem;
}
.bootcn-login-split__link {
color: var(--bs-link-color);
font-size: 0.875rem;
text-underline-offset: 0.2em;
}
.bootcn-login-split__footer {
margin: 1.5rem 0 0;
color: var(--bs-secondary-color);
font-size: 0.875rem;
text-align: center;
}
