shadcn.io is not affiliated with official shadcn/ui
Basic Info Account Block for React
The identity fields of an account as ruled rows that edit in place: full name, a username checked against taken names, an email that stays unverified until confirmed, a masked phone and a date of birth.
Installation
Overview
Let people correct who they are, one detail at a time, with this identity panel for React with Base UI. A hairline frame with a plus mark on each corner holds five ruled rows, each with its label at the start and its value beside it: full name, username, email with a Verified badge, a phone shown masked and a date of birth. Each value is an Editable: a pencil turns it into a field with its own check to save and cross to cancel, Enter saves and Escape puts the old value back. The username is checked as you type against a list of taken names, with the reason in words under the field and Save held until it passes. Changing the email saves it as unverified: the badge says so, the row says which address is still used, and a button stands in for the click in the inbox. The date of birth edits through a Date Input. The foot is a polite status line and an Undo that walks back the last save. It's built from Editable, Date Input, Badge, Button, Field and Guides, with a CSS entrance only and no primary button, because every row saves on its own. For the account page of any app that holds a person's name and contact details.
FAQ
How do I fill it with my own fields?
Edit START (the name, username, email, phone, the ISO birth day, whether the email is verified and the verified address it still writes to as earlier), ROWS (a label, a hint and the field's length) and TAKEN, the usernames that are already someone's. The date of birth, the confirmation day and "as of" are fixed ISO values with AS_OF as today, never the clock, so replace it with the current date when you wire it up. The minimum age is MIN_AGE.
What stays local, and how do I make it real?
Everything. A save changes this page's state and says so in the foot; nothing is sent, nothing is stored and a reload starts again. To make it real, call your endpoint in commitField and saveBirth, change the row only when it answers and put a failure in the same status line. The taken-name list stands in for a server check: call your availability endpoint from the typing handler, debounced, and keep the reason under the field.
How does the username check work?
As you type, the text is tested against a pattern (3 to 20 lowercase letters, digits, dots or underscores) and the taken list, and the reason shows under the field: "lena is taken. Choose another." or "marisol.k is free." While it fails, the field is marked invalid and the save button is held. If you press Enter anyway, the saved value comes back and the status line says why it was not saved. Escape, or clicking away, cancels the edit.
What happens when the email changes?
The new address is saved as unverified. The badge changes from Verified to Unverified, and the row says "Confirm it from your inbox: unverified until then" and which address the app still writes to. The "I clicked the link" button stands in for opening the message; a real app sends the message from its server and flips verified when the link is used. The row keeps its height in both states, so nothing moves.
How do the phone and the date of birth work?
The phone is shown with every digit but the last four hidden and its country code kept; the field shows the whole number while you edit it. The date of birth is shown as text, and editing opens a date field you fill in again: a future date, or an age under 13, is refused with its reason in the same slot and the old date stays.
Is it accessible, and how does it look on a phone?
Every pencil, check and cross has a name that says which field it is for ("Edit username", "Save username"), each field is linked to its hint or reason, and the foot is a polite live region present from the start. Focus returns to the pencil after a save or a cancel. On a phone each label sits above its value, the hints keep room for two lines, and the foot with the status and Undo stays pinned to the bottom of the screen. Emails and numbers keep their reading order in a right-to-left page.
Related
- Pro
Avatar Upload Account
ProfileThe current picture of an account with a file chooser that checks the type and size in words, the last five pictures kept as tiles with Restore and an in-place Delete, and a switch that keeps the history.
- Pro
Profile Appearance Account
ProfileHow a member's name shows to other people: a display name choice, a switch each for the avatar and the handle, and three drawn cells that re-render live as a comment, a mention and a team-list row.
- Pro
Verified Addresses Account
VerificationThe addresses on an account with which are proven by a postcard code: three ruled rows with one primary, a verify band with a code field and a resend, a form that checks the postal code by country, and Remove with Undo.
- Pro
Profile Completion Account
ProfileHow complete a profile is by section: a derived percent over a segmented bar, four sections that open one at a time to their items, and a Not applicable that counts as done and can be undone.
- Pro
Profile Settings
Privacy and consentA profile visibility page: five parts of a profile, each with a menu for who sees it (Everyone, Workspace, Only me), beside a drawn profile card with a Preview as choice (Public, Teammate, Me) that hides what that viewer cannot see.
- Pro
A profile that edits in place: display name, headline, location and a bio that counts 160 characters, each an Editable that saves on its own, a time-zone select that says the local time, a Show my email switch, a list of recent edits and an Undo.