shadcn.io is not affiliated with official shadcn/ui
Phone Not Verified Error Block for React
A full-screen page for an unconfirmed phone number: a Send the code button that waits 30 seconds, a six-slot code field with the demo code printed once, and a list of what is locked that flips to unlocked when the number is verified.
Installation
Overview
Show people what a phone number unlocks, with this phone not verified page for React with Base UI. It's the screen Kerbmoor, a neighbourhood marketplace, shows an account whose number isn't confirmed: the page's two side rails run its full height, with the heading above one framed card made with Guides. In the card, the two steps come first: a Countdown Button Send the code, which waits 30 seconds after each press, then a six-slot Input OTP and the Shine Button Verify the number, the only coloured control. Beside them, "What's limited": posting listings, messaging and payouts are locked, browsing is open, and the three locked rows flip to unlocked when the code is right. The demo code is printed once, after Send the code, because nothing is texted. For marketplaces, booking sites and any account that gates features on a phone number.
FAQ
What stays in the page, and what's the code?
Everything. Send the code waits a moment and then shows "Demo code: 482913" under the field and says nothing was texted; the code is the constant DEMO_CODE. A wrong code names the problem and keeps focus in the field, an incomplete one asks for all six digits, and Verify the number before the code is sent says to send it first. The right code waits under a second, then flips the three locked rows to unlocked and moves focus to Start over. To wire it for real, send the SMS from send and check the code on your server in verify; never put the real code in the page.
How does the code field work?
It is six slots that take digits only: typing fills them in turn, Backspace goes back, and pasting a code fills them all. The field is named by its question and described by the demo-code line and by any problem, and it keeps its order in right-to-left languages. It is one input drawn as six slots, with a single value; anything that isn't a digit is dropped as it is typed or pasted.
Why does Send the code count 30 seconds?
Because every text costs money and invites abuse, and people press twice when nothing arrives at once. The button shows the seconds in its label, drains a fill behind it and never changes size, and a screen reader hears one announcement when it starts. The label changes to "Send it again" after the first send. In your app, match the wait to your provider's rate limit.
How can you tell a locked row from an open one without colour?
By shape and word: a closed padlock and "Locked" in medium weight, an open padlock and "Unlocked", a tick and "Available" for browsing, which never needed the number. The count beside the heading says how many are still locked and is read as text.
Related
- Pro
Email Not Verified Error
Sign-in and identityA full-screen page for an unconfirmed email: a drawn mail list with Inbox, Spam and Promotions tabs showing where the message hides, an I've confirmed it button, a Resend the email button with a 30-second wait and a Change email field.
- Pro
Two-Factor Required Error
Sign-in and identityA full-screen gate for a workspace that now requires two-factor authentication: a grace period drawn as fourteen day segments, three method cells, a Set up now button and a list of steps that follows the chosen method.
- Pro
Captcha Failed Error
Sign-in and identityA full-screen page for a human check that timed out: a box to tick that escalates to a typed question, with no picture to read, over four accordion rows that show what the check looked at and what to do.
- Pro
OTP Verification Login
Codes and approvalsA code step for a parcel locker app: a six-digit field that checks itself on the sixth digit or on a paste, counts wrong codes down from three, and a resend button that waits 30 seconds after it is pressed.
- Pro
Phone Auth Login
Codes and approvalsA start-aligned phone sign-in for a carpool app: a country select, a phone field that lays the number out as you type for that country with a length check, then a six-digit code and a signed-in result.
- Pro
Two-Factor Methods Account
Sign-in methodsAn account's two-factor methods as rows with their role, history and a Test that opens a code field in place, Make primary, a guarded Remove, and a Set up that opens a QR code, a key name or a number.