shadcn.io is not affiliated with official shadcn/ui
Staggered Reveal Sign In Login Block for React
A sign-in page that opens one row at a time: a large heading at the start, the form behind a divider at the end, a valid email opens the password row, eight characters open Keep me signed in, and the button names the next step.
Installation
Overview
Walk a visitor through the sign-in one row at a time, with this staggered reveal login block for React with Base UI. It's the sign-in of Cobblestack, a recipe-box app: the page's two side rails run its full height and one band crosses the screen between two rules, split into a large heading with its mark and one sentence at the start and, behind a divider that meets both rules at a plus mark, the form at the end. The page enters in sequence, the mark, the heading, the sentence and the email Field, each easing up a moment after the one before; then the form follows the visitor. A well-formed email opens the Password Input row, eight characters open the "Keep me signed in" Checkbox, and the Shine Button, the only colored control, says what comes next ("Enter your email", "Enter your password") until the form is complete. Every row is in the page from the start, the rows to come invisible and out of reach and holding their space, so nothing moves, and a row stays open once it has opened. It's built from Field, Input, Password Input, Checkbox, Button, Shine Button and Guides, with CSS transitions only. For sign-ins that should feel like a conversation, not a wall of fields.
FAQ
What happens when I sign in, and what stays in the page?
Nothing leaves the page. Sign in waits under a spinner for less than a second, then shows "You're signed in" with the address you typed, and a polite status message says nothing was sent; Sign out brings the form back with your email still filled in and every row open. To wire it for real, post the email and password to your auth endpoint where the code says so, keep the busy state until it answers, then redirect, or show its error under the field it concerns. The eight-character rule here only gates the reveal; a sign-in form shouldn't judge a password's length, so drop the rule and open the last row on any password, or keep it for a sign-up page.
What opens each row, and can a row close again?
A well-formed email (something, an at sign, a domain with a dot) opens the password row, and eight characters in the password open the last row. A row never closes again: if you change the email to something invalid afterwards, the password row stays, so focus is never taken from a field you are in. Pressing the button still checks every open row and names what is wrong.
Why is the button visible and pressable before the form is complete?
A hidden or disabled button leaves a keyboard user with nothing to press and no explanation. Here the button is always there, in a quiet fill, with a label naming the step ("Enter your email", then "Enter your password"); it's marked aria-disabled but can still be pressed, and pressing it says what is missing under the field and moves focus there. Once the form is complete it takes the primary color and reads "Sign in".
Why do the rows to come take space before they open?
The page is centered in the screen, so a row that grew into place would move the heading and the fields already there. The rows to come are in the page the whole time, invisible and removed from the tab order and from assistive technology until they open, and a dashed outline marks where the password will be. When one opens it turns visible at once, so its field can take focus, and eases down into place.
What does reduced motion change?
Nothing about what opens or when: the rows still follow the visitor's input. Every entrance and every reveal is a CSS transition that is switched off, so the mark, the heading and the fields are there at once and a row appears the moment it opens, with no delay between rows.
Is it usable with a keyboard and a screen reader?
Tab runs through the email, then the password and its show and hide toggle once they have opened, Forgot password, Keep me signed in and the button; a row that hasn't opened is skipped. Opening a row never moves focus, and a polite status message says what opened ("Email accepted. The password field is open."). Each problem is tied to its field, and after signing in focus moves to the result's heading.
Related
- Pro
Centered Sign In Login
Centered formA full-height sign-in page for a team chat app: the product's mark, Google and GitHub rows with lettermark tiles, an or rule, email and password checked on submit, and one Sign in button with a simulated wait and its result.
- Pro
Minimal Sign In Login
Centered formA bare sign-in page for a plain-text notes app: a heading, one sentence, an email and a password written on a hairline and one Sign in button, set at the start of the page with no card, providers or footer.
- Pro
Floating Labels Sign In Login
Centered formA member sign-in page whose labels sit inside the fields and rise on focus, with text or when the browser fills them in, all in CSS, in one bordered group of two cells split by a hairline.
- Pro
Progress Line Sign In Login
Centered formA sign-in page where the band's top rule is the progress line: pressing Sign in locks the fields and a line fills across the rule in 800 ms, then a line in the foot's place says what happened and offers Try again.
- Pro
Full Viewport Sign In Login
Centered formA sign-in page that is the whole screen: a top row with the product's mark and a create-account link, the form centered between rows, a footer row of links and a faint dot grid, with a Caps Lock note under the password.
- Pro
App Download Login
Split with a panelA reverse split sign-in page for a running tracker: a real QR code of a download link with an iOS and Android switch that re-encodes it, a copyable link, and the sign-in form beside it. On a phone the code gives way to a Get the app link.