Two factor and sign in
Push approval
Check your phone: a pulsing device with the incoming request and number matching (the two digits to tap on the phone). State classes for approved, denied and expired change the color, stop the pulse and show a badge.
Example
<div class="grid gap-4 sm:grid-cols-2 items-start">
<div class="auth-card">
<div class="auth-push">
<div class="auth-push-visual" aria-hidden="true">
<span class="auth-push-ring"></span><span class="auth-push-ring"></span>
<div class="auth-push-device"><div class="auth-push-notice"></div></div>
</div>
<header class="auth-header">
<h2 class="auth-title">Check your phone</h2>
<p class="auth-description">We sent a sign in request to your Pixel 8. Tap the number below to approve it.</p>
</header>
<p class="auth-push-number">Number to tap <strong>47</strong></p>
<p class="auth-push-status" role="status">Waiting for approval</p>
</div>
<div class="auth-alt">
<button type="button" class="link link-primary">Send again</button>
<a class="link link-muted" href="#methods">Use another method</a>
</div>
</div>
<div class="grid gap-4">
<div class="auth-card auth-card-compact">
<div class="auth-push auth-push-approved">
<div class="auth-push-visual" aria-hidden="true"><div class="auth-push-device"><div class="auth-push-notice"></div></div></div>
<p class="auth-push-status" role="status">Approved, signing you in</p>
</div>
</div>
<div class="auth-card auth-card-compact">
<div class="auth-push auth-push-denied">
<div class="auth-push-visual" aria-hidden="true"><div class="auth-push-device"><div class="auth-push-notice"></div></div></div>
<p class="auth-push-status" role="status">Request denied on your phone</p>
<button type="button" class="btn btn-sm btn-outline">Try again</button>
</div>
</div>
</div>
</div>Classes
10 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 push approval. On a <div> in the example. Sets grid display, alignment, gap and text style, and --tone.CSS |
|
| Part | Part of the push approval. On a <div> in the example. Sets grid display, alignment, width and height.CSS |
|
| Part | Part of the push approval. On a <span> in the example. Sets absolute position, offsets, border, corner radius, opacity and animation.CSS |
|
| Part | Part of the push approval. On a <div> in the example. Sets width, height, padding, background, border and corner radius.CSS |
|
| Part | Part of the push approval. On a <div> in the example. Sets grid display, gap, padding, background, border and corner radius.CSS |
|
| Part | Part of the push approval. On a <p> in the example. Sets flex display, alignment, gap, margin, text size and font weight.CSS |
|
| Part | Part of the push approval. On a <p> in the example. Sets inline-flex display, alignment, gap, margin, text size and font weight.CSS |
|
| Modifier | Modifier, combined with the auth-push class. On a <div> in the example. Sets hidden by default, animation, text color, generated content, absolute position and offsets, and --tone and --tone-fg.CSS |
|
| Modifier | Modifier, combined with the auth-push class. On a <div> in the example. Sets hidden by default, animation, text color, generated content, absolute position and offsets, and --tone and --tone-fg.CSS |
|
| Modifier | Modifier, combined with the auth-push class. Not used in the example above. Sets hidden by default, animation and opacity, and --tone.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">
<!-- Push approval: start from the base class, then add modifiers -->
<div class="grid gap-4 sm:grid-cols-2 items-start">
<div class="auth-card">
<div class="auth-push">
<div class="auth-push-visual" aria-hidden="true">
<span class="auth-push-ring"></span><span class="auth-push-ring"></span>
<div class="auth-push-device"><div class="auth-push-notice"></div></div>
</div>
<header class="auth-header">
<h2 class="auth-title">Check your phone</h2>
<p class="auth-description">We sent a sign in request to your Pixel 8. Tap the number below to approve it.</p>
</header>
<p class="auth-push-number">Number to tap <strong>47</strong></p>
<p class="auth-push-status" role="status">Waiting for approval</p>
</div>
<!-- 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
- Use
buttonfor actions andafor navigation. Icon only buttons need anaria-label; decorative icons carryaria-hidden="true". - Announces itself with
role="status"(polite) orrole="alert"(assertive). Use alert only for messages that need immediate attention. - 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.