Login with SSO
A sign-in card offering single sign-on and an email link first, then email and password.
Installation
Usage
Wire "Continue with SSO" to your identity provider and "Email me a sign-in link" to a magic-link flow; remove either if you do not offer it. The password form is a normal POST form.
Accessibility
- Each option is a button or field with visible text; icons are decorative.
- The separator between options is announced as "Or sign in with a password" (
role="separator"with a label), not as loose text. - The legal links are real links with descriptive text.
Dependencies
- Bootstrap 5.3+ CSS.
themes/tokens/tokens.css.- The
cardcomponent. - The
inputcomponent. - The
buttoncomponent. - The
separatorcomponent.
Source
The exact files the CLI installs (login-sso@1.0.0). View on GitHub · Report an issue
html
<section class="bootcn-login-sso" aria-labelledby="bootcn-login-sso-title">
<div class="card bootcn-card">
<header class="bootcn-card__header bootcn-login-sso__header">
<h2 class="bootcn-card__title" id="bootcn-login-sso-title">Welcome back</h2>
<p class="bootcn-card__description">Sign in with your company account or your email.</p>
</header>
<div class="bootcn-card__content bootcn-login-sso__body">
<button type="button" class="btn bootcn-button bootcn-button--outline w-100">
<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"
>
<circle cx="7.5" cy="15.5" r="4.5" />
<path d="m10.7 12.3 9.3-9.3" />
<path d="m17 6 3 3" />
<path d="m14 9 2 2" />
</svg>
Continue with SSO
</button>
<button type="button" class="btn bootcn-button bootcn-button--outline w-100">
<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="5" width="18" height="14" rx="2" />
<path d="m3 7 9 6 9-6" />
</svg>
Email me a sign-in link
</button>
<div class="bootcn-separator-label" role="separator" aria-label="Or sign in with a password">
<span class="bootcn-separator-label__text" aria-hidden="true">Or with a password</span>
</div>
<form class="bootcn-login-sso__form" action="#" method="post">
<div class="bootcn-field">
<label for="bootcn-login-sso-email" class="form-label bootcn-field__label">Email</label>
<input
type="email"
class="form-control bootcn-input"
id="bootcn-login-sso-email"
name="email"
autocomplete="email"
placeholder="you@example.com"
required
/>
</div>
<div class="bootcn-field">
<div class="bootcn-login-sso__label-row">
<label for="bootcn-login-sso-password" class="form-label bootcn-field__label"
>Password</label
>
<a class="bootcn-login-sso__link" href="#forgot-password">Forgot password?</a>
</div>
<input
type="password"
class="form-control bootcn-input"
id="bootcn-login-sso-password"
name="password"
autocomplete="current-password"
required
/>
</div>
<button type="submit" class="btn bootcn-button bootcn-button--default w-100">
Sign in
</button>
</form>
</div>
<footer class="bootcn-card__footer bootcn-login-sso__footer">
<p class="mb-0">
No account yet? <a class="bootcn-login-sso__link" href="#sign-up">Create one</a>
</p>
</footer>
</div>
<p class="bootcn-login-sso__legal">
By continuing you agree to our <a href="#terms">Terms of Service</a> and
<a href="#privacy">Privacy Policy</a>.
</p>
</section>css
.bootcn-login-sso {
width: 100%;
max-width: 24rem;
margin-inline: auto;
}
.bootcn-login-sso__header {
align-items: center;
text-align: center;
}
.bootcn-login-sso__body,
.bootcn-login-sso__form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.bootcn-login-sso__form .bootcn-field {
margin: 0;
}
.bootcn-login-sso__label-row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 1rem;
}
.bootcn-login-sso__link {
color: var(--bs-link-color);
font-size: 0.875rem;
text-underline-offset: 0.2em;
}
.bootcn-login-sso__footer {
justify-content: center;
color: var(--bootcn-muted-foreground);
font-size: 0.875rem;
}
.bootcn-login-sso__legal {
margin: 1rem 0 0;
color: var(--bootcn-muted-foreground);
font-size: 0.75rem;
text-align: center;
}
.bootcn-login-sso__legal a {
color: inherit;
text-underline-offset: 0.2em;
}
