Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Step Verification Accordion Login Block for React

A sign-in for a clinic as an accordion of three sections: finishing one folds it to a one-line summary with a check and opens the next, sections after the open one are locked but reachable, and Edit reopens a finished one.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Keep a sign-in on one short list that folds as it goes, with this step verification login block for React with Base UI. It's the sign-in of Wardlane Clinics, clinic booking: the page's side rails run the full height of the screen and one band crosses it between two rules, holding a centred column with an Accordion of ruled rows, Email, Password and Code. Only the section in hand is open. Finishing it folds it to a one-line summary with a check and "Edit", and opens the next. A section after the open one is locked: it shows a lock and what it waits for, stays reachable by keyboard, and pressing it says so. Any finished section reopens with Edit, which locks the sections after it again until they are done again. The sections are one height, so nothing moves, and the code section is a six-digit Input OTP that prints its demo code once. It's built from Accordion, Input, Password Input, Input OTP, Button, Shine Button and Guides, with CSS transitions only. For sign-ins and verifications that should read as a checklist.

FAQ

What stays in the page, and what is the demo code?

Everything. Any address that looks like an email and any password open the next section, and the code section accepts 482913, printed once under the field. Verifying waits less than a second, then the accordion gives way to "You're signed in" in the same space, with a polite status message saying nothing was sent. In a product, check each answer with your server as it's given and keep the busy state until it answers.

What does a locked section do when it's pressed?

It stays focusable, on purpose: a disabled row would drop out of the tab order and leave a keyboard user with no way to learn why. Pressing or activating it changes nothing in the sections and a polite message says "Finish email first.", naming the step that is waiting. A lock icon and the words "Locked until email is done" say the same on the row.

What does Edit lock again?

Pressing a finished section's row, marked "Edit", reopens it and locks the sections after it. They keep what you typed, apart from the code, so you confirm them again in order: finishing the email opens the password with its old value still there. A polite message says which section is being edited.

How do I move through it with a keyboard?

Tab goes through the open section's fields and button and the rows' triggers, and Enter or Space on a trigger opens it when it's allowed. The arrow keys don't move between the triggers here, so use Tab. Each row is a heading with a button inside, so a screen reader's heading list shows the three steps.

Are the closed sections still in the page?

Their fields stay in the page, hidden until opened, so what was typed is never lost.The answers themselves live in the block's own state, so on every version a section you return to shows what you gave.

How does the page stay the same height when a section opens?

Every section's body is one fixed height, tall enough for the tallest (the code), so opening one while another closes moves nothing, and the result that replaces the accordion shares its space. The page is centered, so anything that grew would move the heading too.

  • Pro

    A three-step sign-in for a support desk: a vertical Steps rail at the start (Email, Password, Code) with what was given and an Edit button on each finished step, and the one panel of the step in hand at the end.

  • Pro

    A three-step sign-in for a home lender: hairline cells across the top that fill as each step is done, one thin progress line with a time line, a different field for each step, and a finished page that ticks off three checks.

  • Pro

    An identifier-first sign-in for an invoicing app: one email field, a lookup against two typed accounts, then either the password step with the address kept as a badge or account creation with the address carried over.

  • Pro

    A split sign-in step for an investing app: a six-digit code field beside a demo authenticator whose code and draining ring change every 30 seconds, where the current code and the one before it both sign in.

  • Pro

    Backup Code Login

    Codes and approvals

    A sign-in step that takes one of eight single-use backup codes: the field adds the dash as you type, a saved sheet strikes spent codes through, and signing in offers new codes behind an alert dialog.

  • Pro

    Account Locked Login

    Recovery and reset

    A locked-account page for a point-of-sale system that draws the lockout ladder, marks the rung the account is on with a fixed unlock time, and offers an unlock link by email or a password reset.