Skip to content
Design System
GitHub

Asks for a fresh check (an authenticator code or the password) before a sensitive action, then hands back to the action.

Code

Install
npx shadcn add @syncrobotic/step-up-dialog

Also installs: lucide-react@^1, @syncrobotic/use-step-up, @syncrobotic/button, @syncrobotic/dialog, @syncrobotic/field, @syncrobotic/input, @syncrobotic/input-otp

Overview

When to use

  • Revoking an API key or a device, rotating a webhook secret, removing a member, deleting a project.
  • Any action the server guards with a fresh check (sudo mode).

Use something else

  • Confirming a consequence, with no identity check: Alert dialog.
  • Signing in, or the second step of a sign-in: the auth-2fa block.

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Password

Setup

Zh tw

Usage rules

  • Open it from the server's answer (useStepUp does), not before every sensitive action: the server knows whether the session is fresh.
  • The action the person asked for waits and runs after the check, so they never press it twice. Cancel leaves everything as it was, and says so.
  • A failed check says why from its code (labels.errors), clears the field and puts focus back in it. A code sends itself on its sixth digit, once.
  • With no second factor yet (setup), there is nothing to check: offer the setup page and cancel the action.

Changelog

  • 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
  • 0.55.02026-11-27First release: a 6-digit code (sent on the sixth digit, once) or the password, through your verify(); a failure's message from its code, announced, the field cleared and focused. With setup, offers onSetup instead. Opened by useStepUp.

How to upgrade