shadcn.io is not affiliated with official shadcn/ui
Create Account Handle Check Login Block for React
A sign-up page for a community forum in two columns of fields: a handle with an at sign that checks itself against a typed taken list and offers three tries as buttons, then the email, a password with an eight-character hint and Create account.
Installation
Overview
Let people find a free name before they fill in the rest, with this create account login block for React with Base UI. It's the sign-up page of Yarnrow, a community forum: the page's side rails run the full height of the screen and one band crosses it between two rules, split into two columns of fields by a divider that meets both with a plus mark. At the start sit the mark, the heading and "Pick a handle", an Input Group with an @ in front. A moment after the typing stops a Spinner shows, then the answer, checked against a typed list of taken handles (maya, admin and nick); a taken handle offers three tries as buttons that fill the field. At the end are the email, a Password Input with an eight-character hint and the Shine Button, the only colored control. It's built from Input Group, Spinner, Field, Password Input, Input, Shine Button and Guides, with CSS transitions only. For forums, communities and any product where the name is public.
FAQ
Is the handle check real, and how do I wire it?
No: it looks the handle up in a typed list of three taken ones and waits a moment, so every visitor sees the same answers and nothing is sent. In a product, ask your server whether the handle is free once the typing has paused, and treat the answer as advice: reserve the handle when the account is created and handle the case where someone else took it in between, since two people can both see it free. Creating the account waits less than a second, then shows what a real product would do next, with a polite message saying nothing was sent.
When does the check run?
Four tenths of a second after the typing stops, the check starts and shows a spinner for another four tenths, then the line gives its answer. Every keystroke starts the wait again, and a handle with a wrong shape (too short, too long or with characters other than letters, numbers, dots, dashes and underscores) is named after the pause, without a spinner. The answer is announced once, through a polite status message, not letter by letter.
What if I send the form before the check finishes?
It still can't get through with a taken name. Sending checks the handle again against the same list, and a taken or badly shaped one is named under the field, with focus on it. The check on screen is only a courtesy to the visitor, never the gate.
Where do the three tries come from, and what does pressing one do?
They are the typed handle with -4, .k or _writes added, each checked to be valid and free. Pressing one fills the field, starts the check again and returns focus to the field, so a keyboard user can carry on typing. The row keeps its space while there are no tries, so nothing moves when it appears.
Why is there no password strength meter?
The only rule here is eight characters, stated under the field and checked when you send. A strength meter measures guessability, which is a separate and bigger feature; see the self service reset block for it. Whatever you choose, let people paste into the field and keep the show and hide eye.
How does the two-column layout fall back on a small screen?
Below the large breakpoint the columns stack in reading order: the heading and the handle first, then the email, the password and the button, so the field that gives the page its point comes first and the Create account button is still on the first screen of a phone. The divider and its corner marks only exist when there are two columns.
Related
- Pro
Tabbed Sign In And Sign Up Login
Centered formOne column for a writer and editor marketplace with Sign in and Create account as two tabs, each with a Google row and its own fields, the email carried between them and a card that never changes height.
- Pro
Team Invite Acceptance Login
Workspaces and rolesAn invitation page for a shared team calendar: the workspace tile, Maya invited you to Hollin Row Studio, the Editor role and three members as initials with 9 more beside a form with the invited address locked, a name and a new password, or just the password for an existing account.
- Pro
Email First Sign In Login
Step by stepAn 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
Self-Service Password Reset Login
Recovery and resetA reset page for an HR portal with a new password and confirm field, a five-segment strength meter, and a list of requirements that each show a glyph and words, never colour alone.
- Pro
Terms Consent Login
Sign-up and consentA full-height agreements screen for a tenant app: a select-all checkbox that turns mixed over the two required agreements, an optional product-updates box that is never pre-ticked, and a Continue button that names what is missing instead of being disabled.
- Pro
Cookie Consent Login
Sign-up and consentA bakery subscription's cookie choices shown open over a drawn sign-in page: Essential locked on, Analytics and Marketing switches that start off, and three equal buttons, Reject all, Accept all and Save choices.