Two factor and sign in
Sign in progress
A compact step indicator for the sign in flow: password, second factor, done. Completed steps get .auth-flow-done (with a check), the current one aria-current="step".
Example
<div class="grid gap-6 max-w-sm">
<ol class="auth-flow" aria-label="Sign in progress">
<li class="auth-flow-step" aria-current="step"><span class="auth-flow-label">Password</span></li>
<li class="auth-flow-step"><span class="auth-flow-label">Verify</span></li>
<li class="auth-flow-step"><span class="auth-flow-label">Done</span></li>
</ol>
<ol class="auth-flow" aria-label="Sign in progress">
<li class="auth-flow-step auth-flow-done"><span class="auth-flow-label">Password<span class="sr-only">, completed</span></span></li>
<li class="auth-flow-step" aria-current="step"><span class="auth-flow-label">Verify</span></li>
<li class="auth-flow-step"><span class="auth-flow-label">Done</span></li>
</ol>
<ol class="auth-flow" aria-label="Sign in progress">
<li class="auth-flow-step auth-flow-done"><span class="auth-flow-label">Password<span class="sr-only">, completed</span></span></li>
<li class="auth-flow-step auth-flow-done"><span class="auth-flow-label">Verify<span class="sr-only">, completed</span></span></li>
<li class="auth-flow-step auth-flow-done"><span class="auth-flow-label">Done<span class="sr-only">, completed</span></span></li>
</ol>
</div>Classes
4 classes. Click a name to copy it. Utilities on the same element always win over component defaults, so any of them can be adjusted with plain utility classes.
| Class | Type | What it does |
|---|---|---|
| Base | Base class of the sign in progress. On an <ol> in the example. Sets grid display, grid tracks, gap, margin and padding, and --tone.CSS |
|
| Modifier | Modifier, combined with the auth-flow class. On a <li> in the example. Sets grid display, gap, width, text size, font weight and text color.CSS |
|
| Part | Part of the sign in progress. On a <span> in the example. Sets flex display, alignment, gap, overflow, text style and generated content.CSS |
|
| Modifier | Modifier, combined with the auth-flow class. On a <li> in the example. Sets text color, generated content, border and background.CSS |
Usage
Components ship inside the same stylesheet as the utilities. There is nothing else to install and no script to load: link Monsoon and write the markup.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/monsooncss">
<!-- Sign in progress: start from the base class, then add modifiers -->
<div class="grid gap-6 max-w-sm">
<ol class="auth-flow" aria-label="Sign in progress">
<li class="auth-flow-step" aria-current="step"><span class="auth-flow-label">Password</span></li>
<li class="auth-flow-step"><span class="auth-flow-label">Verify</span></li>
<li class="auth-flow-step"><span class="auth-flow-label">Done</span></li>
</ol>
<ol class="auth-flow" aria-label="Sign in progress">
<li class="auth-flow-step auth-flow-done"><span class="auth-flow-label">Password<span class="sr-only">, completed</span></span></li>
<li class="auth-flow-step" aria-current="step"><span class="auth-flow-label">Verify</span></li>
<li class="auth-flow-step"><span class="auth-flow-label">Done</span></li>
</ol>
<ol class="auth-flow" aria-label="Sign in progress">
<li class="auth-flow-step auth-flow-done"><span class="auth-flow-label">Password<span class="sr-only">, completed</span></span></li>
<li class="auth-flow-step auth-flow-done"><span class="auth-flow-label">Verify<span class="sr-only">, completed</span></span></li>
<!-- the full example is in the Code tab above -->Theme it with --seed on any ancestor, for example style="--seed: #0d9488", and force a scheme with class="dark" or class="light" on a wrapper.
Accessibility
- Every interactive part shows a visible focus ring with
:focus-visible, and tone colors pair with-foregroundtokens that keep text at 4.5:1 or better in light and dark mode.