shadcn.io is not affiliated with official shadcn/ui
Forgot Password Login Block for React
A forgot-password page for a school learning platform that never says whether an account exists, offers the right mail domain when one is a letter off, and resends the link on a 30-second wait.
Installation
Overview
Ask for a reset link without giving away who has an account, with this forgot password login block for React with Base UI. It's the reset request of a Willowbook sign-in, a school learning platform: the page's side rails run the full height of the screen and one band crosses it, holding a centred column with one Input for the email and one Send reset link button. Whatever is typed, the result reads "If an account exists for that address, a reset link is on its way", and says why: the page answers the same way either way, so nobody can use it to find out who has an account. When the typed domain is one edit from a known mail domain (a letter wrong, missing, extra or swapped, as in "gmial.com"), a hint under the field offers the right address. Resend is a Countdown Button that waits 30 seconds after the first send and after each resend, and the third link is the last one. It's built from Input, Countdown Button, Field, Button, Shine Button and Guides, with a CSS entrance only. For reset requests and any step that asks for an address without confirming it exists.
FAQ
What stays in the page, and how do I wire it for real?
Everything. The demo address with a slip, tovah.sandell@gmial.com, is printed once under the field so the hint can be seen. Sending waits 700 milliseconds and shows the result in the form's place; nothing is sent, no link is made and no timer runs on a server. In a product, post the address to your auth endpoint, answer the same way whether or not an account has it, send the link only if one does, and rate-limit the endpoint by address and by network: the page's three-link limit is typed text, not a guard.
Why does it say the same thing for every address?
A page that answers "no account with that address" lets anyone test a list of addresses and learn who is a customer, a teacher or a pupil. So the result is worded to be true either way ("If an account exists for ..."), and the page says that it does this. For the same reason the real timing and the real message should not differ between an address that exists and one that doesn't; a demo can't show that part, your server has to keep it.
How does the typo hint decide?
A small function compares the part after the @ with five known mail domains (gmail.com, outlook.com, yahoo.com, icloud.com, hotmail.com). It offers a correction only when the typed domain is exactly one edit from one of them: a letter changed, one missing, one extra, or two neighbouring letters swapped. A domain that is already on the list, or far from all of them, gets no hint, so a school's own domain is never "corrected". The hint is worked out when you leave the field or press Send, never while you are still typing, and typing again clears it.
What does the first press do with a likely slip?
It stops at the hint, names it in the polite status line and puts focus back in the field; the button is never disabled. A second press with the same text sends what you typed, because the hint is advice and the address may really be unusual. Pressing the corrected address in the hint puts it in the field and keeps the focus there.
How does the resend wait work?
The first send starts a 30-second wait, so the button opens in its waiting state: the label counts down ("Wait 30s"), presses are ignored while focus stays on it, and a fill drains behind the label. Each resend says how many of the three links are used, in a typed line under the button; after the third the button still answers, now saying to look in spam or ask the school's admin. With reduced motion the fill is hidden and the count stays as text.
Related
- 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
Recovery Email Confirmation Login
Recovery and resetA recovery step for a casual game that shows the address on file masked and asks for the full address before it sends a code, then takes the six-digit code, with a helpdesk note for anyone without access.
- Pro
Account Locked Login
Recovery and resetA locked-account page for a point-of-sale system that draws the lockout ladder, marks the rung the account is on with a fixed unlock time, and offers an unlock link by email or a password reset.
- Pro
Lockout Recovery Login
Recovery and resetA recovery chooser for a utility account where ticking what you still have (email, phone, a backup code or none) ranks the ways back in live, with a daily request count.
- Pro
Helpdesk Ticket Login
Recovery and resetA sign-in helpdesk panel for a law firm: an employee ID, a category that shows its usual wait at once, a description with a count, and a ticket card with a reference and the queue facts.
- Pro
Security Questions Login
Recovery and resetA sign-in step with three security questions where any two correct answers sign in: hints on demand, answers compared without capitals, accents or extra spaces, three attempts, and a locked state with a way out.