Two factor and sign in
Method picker
Second factor choices as selectable cards on native radio inputs: icon, title, a short explanation, a Recommended badge and when it was last used. Arrow keys move between methods; unavailable methods can be disabled.
Example
<form class="auth-card auth-card-wide" action="#" onsubmit="event.preventDefault()">
<header class="auth-header auth-header-start">
<h2 class="auth-title">Choose how to verify</h2>
<p class="auth-description">Pick a second step for signing in to you@example.com.</p>
</header>
<fieldset class="auth-methods">
<legend class="sr-only">Verification method</legend>
<label class="auth-method">
<input type="radio" name="mfa-method" value="app" checked>
<span class="auth-method-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="6.5" y="2.5" width="11" height="19" rx="2.5"/><path d="M10.5 18.5h3"/><path d="M9.5 9.5h5M9.5 12.5h3"/></svg></span>
<span class="auth-method-body">
<span class="auth-method-title">Authenticator app <span class="badge badge-success badge-sm">Recommended</span></span>
<span class="auth-method-text">A 6 digit code from an app like 1Password or Google Authenticator</span>
<span class="auth-method-meta">Last used 2 days ago</span>
</span>
</label>
<label class="auth-method">
<input type="radio" name="mfa-method" value="push">
<span class="auth-method-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 16.5V11a6 6 0 1 1 12 0v5.5l1.5 2h-15z"/><path d="M10 21a2.2 2.2 0 0 0 4 0"/></svg></span>
<span class="auth-method-body">
<span class="auth-method-title">Push notification</span>
<span class="auth-method-text">Approve the sign in on your phone</span>
</span>
</label>
<label class="auth-method">
<input type="radio" name="mfa-method" value="passkey">
<span class="auth-method-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9.5" cy="8" r="3.5"/><path d="M3.5 20a6 6 0 0 1 9.4-4.9"/><circle cx="17.5" cy="12.5" r="2.5"/><path d="M17.5 15v6l1.6-1.3M17.5 18l1.4 1"/></svg></span>
<span class="auth-method-body">
<span class="auth-method-title">Passkey</span>
<span class="auth-method-text">Use your fingerprint, face or screen lock</span>
</span>
</label>
<label class="auth-method">
<input type="radio" name="mfa-method" value="key" disabled>
<span class="auth-method-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="2.5" width="6" height="6" rx="1"/><rect x="7" y="8.5" width="10" height="13" rx="3"/><circle cx="12" cy="15" r="1.75"/></svg></span>
<span class="auth-method-body">
<span class="auth-method-title">Security key</span>
<span class="auth-method-text">Not available in this browser</span>
</span>
</label>
<label class="auth-method">
<input type="radio" name="mfa-method" value="sms">
<span class="auth-method-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4.5 5.5h15a1 1 0 0 1 1 1V16a1 1 0 0 1-1 1H9l-4.5 3.5V6.5a1 1 0 0 1 1-1z"/><path d="M8.5 11.25h.01M12 11.25h.01M15.5 11.25h.01" stroke-width="2.4"/></svg></span>
<span class="auth-method-body">
<span class="auth-method-title">Text message</span>
<span class="auth-method-text">We send a code to +55 •• •••••-0474</span>
</span>
</label>
<label class="auth-method">
<input type="radio" name="mfa-method" value="email">
<span class="auth-method-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="5" width="18" height="14" rx="2.5"/><path d="m3.5 7.5 8.5 6 8.5-6"/></svg></span>
<span class="auth-method-body">
<span class="auth-method-title">Email</span>
<span class="auth-method-text">We send a code to y•••@example.com</span>
</span>
</label>
</fieldset>
<button class="btn btn-primary btn-block">Continue</button>
</form>Classes
7 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 |
|---|---|---|
| Part | Part of the method picker. On a <fieldset> in the example. Sets grid display, gap, width, margin, padding and border, and --tone.CSS |
|
| Base | Base class of the method picker. On a <label> in the example. Sets grid display, grid tracks, alignment, gap, padding and background.CSS |
|
| Part | Part of the method picker. On a <span> in the example. Sets grid display, alignment, width, height, text color and background.CSS |
|
| Part | Part of the method picker. On a <span> in the example. Sets grid display, gap and width.CSS |
|
| Part | Part of the method picker. On a <span> in the example. Sets flex display, alignment, gap, text size, font weight and text style.CSS |
|
| Part | Part of the method picker. On a <span> in the example. Sets text size, text style and text color.CSS |
|
| Part | Part of the method picker. On a <span> in the example. Sets inline-flex display, alignment, gap, margin, text size and text color.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">
<!-- Method picker: start from the base class, then add modifiers -->
<form class="auth-card auth-card-wide" action="#" onsubmit="event.preventDefault()">
<header class="auth-header auth-header-start">
<h2 class="auth-title">Choose how to verify</h2>
<p class="auth-description">Pick a second step for signing in to you@example.com.</p>
</header>
<fieldset class="auth-methods">
<legend class="sr-only">Verification method</legend>
<label class="auth-method">
<input type="radio" name="mfa-method" value="app" checked>
<span class="auth-method-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="6.5" y="2.5" width="11" height="19" rx="2.5"/><path d="M10.5 18.5h3"/><path d="M9.5 9.5h5M9.5 12.5h3"/></svg></span>
<span class="auth-method-body">
<span class="auth-method-title">Authenticator app <span class="badge badge-success badge-sm">Recommended</span></span>
<span class="auth-method-text">A 6 digit code from an app like 1Password or Google Authenticator</span>
<span class="auth-method-meta">Last used 2 days ago</span>
<!-- 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
- Give every control a visible
labellinked withfor, or anaria-labelwhen the purpose is obvious from context. Link help and error text witharia-describedby; invalid styles use:user-invalid, so they appear only after the user interacts. - Checkboxes and radios stay real inputs, so they keep native keyboard behavior (Space toggles, arrow keys move within a radio group) and form submission.
- Use
buttonfor actions andafor navigation. Icon only buttons need anaria-label; decorative icons carryaria-hidden="true". - 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.