shadcn.io is not affiliated with official shadcn/ui
Full Viewport Sign In Login Block for React
A 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.
Installation
Overview
Make the sign-in the whole screen rather than a form on a page, with this full viewport login block for React with Base UI. It's the sign-in of Larkspire, a birdwatching log: the page's two side rails run its full height and one band fills the screen between two rules with a plus mark where each meets a rail. In the band a top row holds the product's mark at the start and "New to Larkspire? Create an account" at the end, the form sits centered between the rows with a heading, one sentence, an email Input, a Password Input and the Shine Button, the only colored control, and a footer row carries Terms, Privacy, Help and the language the page is written in. The rows add no rule of their own, so the band's two rules are the page's only horizontal lines, and a faint Dot Pattern fills the empty space around the form and fades out under it. The password field watches the Caps Lock key and says so under the field, in the line that also holds its problem, so the page never moves. It's built from Field, Input, Password Input, Button, Shine Button, Dot Pattern and Guides, with a CSS entrance only. For apps whose sign-in is a destination of its own.
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. Create an account, Forgot password and the footer links go to #, so point them at your own routes. To wire the form 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.
How does the Caps Lock note work, and when can it be wrong?
Browsers don't let a page ask whether Caps Lock is on; they report it on key events. The password field reads it from every key you press or release in it, shows "Caps Lock is on" under the field and also says it through the page's polite status message, and clears the note when focus leaves the field. So the note appears after the first key, not before, and a Caps Lock turned on while you're elsewhere shows up as soon as you type. If the field has a problem to show, the problem takes the line and the note waits.
Why is the Sign in button never disabled?
A disabled button can't explain itself, and keyboard users can't reach it. Here it stays enabled: pressing it with an empty or malformed email, or no password, marks those fields invalid, writes one sentence under each and moves focus to the first, which reads its problem out. Typing clears that field's problem, and each field keeps a line for its problem even when there is none, so nothing moves.
What is the dot grid, and does it move?
It's the Dot Pattern with its wave and its pointer light turned off, so it never moves, drawn in the text color at 10% in the space between the two rows only, so no text sits on a dot. A mask clears the middle, where the form is, and fades the dots out toward the rows, so they gather at the band's two sides. It follows the theme in light and dark and sits behind everything. Remove the DotPattern to get a plain band.
What changes on a phone?
The band keeps its three rows. In the top row the "New to Larkspire?" words go and only the Create an account link stays beside the mark, the form keeps its width and the Sign in button stays on the first screen, and the footer row wraps its links and the language onto two lines when they don't fit. The page is still at least a screen tall.
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
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
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
Staggered Reveal Sign In Login
Split with a panelA 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.
- Pro
Alert Banner Login
Centered formA full-height sign-in page for a database host with a maintenance notice pinned above the form: a quiet alert with the window in UTC, a Details popover and a Dismiss that never moves the form.