shadcn.io is not affiliated with official shadcn/ui
Facial Recognition Login Block for React
An office check-in page with a drawn viewfinder over four prompts (look straight, turn left, turn right, blink): press Start and each prompt runs for 800 ms, with no camera opened.
Installation
Overview
Guide a face check without ever opening a camera, with this facial recognition login block for React with Base UI. It's the check-in page of Atriumly, an office front desk: the page's rails run the full height of the screen and one band crosses it, and in the band a centred column draws a viewfinder, a rounded square with four corner marks, a face outline and a ring, in a framed Guides inset. Under it four hairline cells name the prompts: Look straight, Turn left, Turn right and Blink. Pressing the Shine Button, Start check-in, runs each prompt for 800 ms: the ring fills once, the drawn face turns or blinks to show what is asked, and the cell for the prompt is marked while the ones before it are ticked. Cancel stops the run. After the fourth prompt the result replaces the body in the same space and takes focus. Nothing is captured, scanned or stored, and the header says the camera is never opened. It's built from Button, Shine Button and Guides, with a CSS entrance only. For office and event check-in, kiosks and any flow that asks for a face.
FAQ
Does this use my camera?
No. The viewfinder is a drawing and the prompts are timers: the page never calls getUserMedia, never reads a frame and never stores anything, and the result says so. In a product you would ask for the camera only after the person presses Start, show the live video in place of the drawing, and send frames to a liveness check on your server or from a vendor, keeping nothing longer than the check needs.
How does the run work?
Start sets the first prompt and a chain of four 800 ms timers advances it. The ring is drawn again for each prompt so it fills once, the face only changes classes (the head and features slide a little, the eyes close for the blink), and the cells show where you are. Cancel clears the timers, resets the drawing and returns focus to the start button, which then reads Try again. Leaving the page drops a pending timer.
Why is the run announced only at the start and the end?
Each prompt lasts 800 ms, too short to read aloud in turn, so the polite status line says once that the check-in started and what the four prompts are, and again when it ends. The cells and the line under the viewfinder show each prompt for people who can see them. The result's heading takes focus.
Should a face check be the only way in?
No. Face checks fail for people with different faces, for poor light and for anyone who can't or won't use a camera, and some places regulate biometric data. The quiet "Use your badge code" link is the other way in; point it at your own route, and ask for consent before a real camera opens.
Related
- Pro
Biometric Auth Login
Biometrics and keysA health app's sign-in page built around a press-and-hold fingerprint pad: hold it for two seconds to match, let go early and it says so, or press Scan if you cannot hold.
- Pro
Voice Auth Login
Biometrics and keysA smart-speaker app's sign-in page that asks you to say three words: press Start speaking and the passphrase lights up word by word over a waveform, with no microphone opened.
- Pro
Passkey Login
PasswordlessAn online bank's sign-in page and its passkey chooser shown open over a drawn sign-in screen: two passkeys as radio rows, Cancel and Continue, a verifying step and a signed-in result, with the real dialog behind the Use your passkey button.
- Pro
Hardware Key Login
Biometrics and keysA custody service's security-key page: a USB or NFC switch, three sign-in states, one button that waits for the key and then accepts it, and a drawing of a key and a port or a reader.
- Pro
PIN Entry Login
Biometrics and keysA wallet app's unlock page: four dots over a keypad of three by four keys on hairline cells, typed digits and Enter, tries counted down and a lock after the third miss.
- Pro
Pattern Lock Login
Biometrics and keysA private gallery's unlock page with a three by three grid of dots: drag across them with a pointer or use the arrow keys, Space and the digits 1 to 9, then Unlock; three tries before it locks.