Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Parental Gate Login Block for React

A grown-ups' gate for a kids' app: a sum to type in digits that moves to the next of three questions when wrong, then a four-digit parent PIN, with an honest note that it is not age verification.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Put a short check between a child and a parent's settings, with this parental gate login block for React with Base UI. It's the gate of Pebblereads, a kids' reading app: a whole screen with the page's rails and one band across it, start-aligned and friendly, with a mark, three drawn pebbles, a heading and one sentence. The gate has two steps in one space. First a question only a grown-up is likely to answer quickly, a sum to type in digits ("What is twelve times eight?") in an Input; a wrong answer says "Not quite" and moves to the next of three typed questions. Then the parent PIN, four digits in the Input OTP field. A right PIN opens a short grown-up settings state with a way back. The answer and the PIN are printed once as hints so anyone can pass the demo. The one Shine Button runs both steps, and under it a plain note says this is a gate, not age verification. It's built from Field, Input, Input OTP, Button, Shine Button and Guides, with a CSS entrance only. For children's apps, family accounts and settings that a young reader should not open by accident.

FAQ

What stays in the page, and how do I wire it for real?

Everything. The three questions, their answers and the PIN are typed constants printed as hints, and nothing is stored or sent. In a product, keep the parent PIN on your server (or in the device's keystore), compare it there, rate-limit wrong guesses, and ask the question from a larger set in a random order so a child cannot learn them. A gate like this protects against accidents, not against a determined child.

Is this age verification?

No, and the page says so under the button. A sum slows a young reader down and a PIN keeps a settings screen closed, but nothing here can tell who is holding the device or how old they are. If a law or a store policy asks for a real age check, use your platform's parental controls, an adult account or a verification service, and treat this gate as a convenience on top.

What happens on a wrong answer?

The page says "Not quite. Here is another one.", clears the field, puts focus back in it and shows the next of the three questions, wrapping round after the last. A right answer moves on to the PIN step. Pressing with nothing typed names the problem and focuses the field instead.

How does the PIN field work?

It is the catalog's code field with four slots: it takes digits only, a paste of the whole PIN fills all four, and Enter presses the button. A wrong PIN clears the slots, says so under them and focuses the first slot. A right one waits half a second and opens the settings state, with a button that closes the gate again.

Is it usable with a keyboard and a screen reader?

Yes. Each step has a labelled field, the question is the label, each problem is read with its field, and the page's one status line speaks each result. The step that is not showing is hidden and inert, so the tab order only ever holds the current one.

  • Pro

    PIN Entry Login

    Biometrics and keys

    A 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

    A shared-device check-in: large touch keys for a six-digit badge, a private session with a 30-second demo countdown that starts on the press, Extend, Still there? and a screen that clears itself.

  • Pro

    Security Questions Login

    Recovery and reset

    A 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.

  • Pro

    Age Restricted Error

    Blocked and limited

    A host page and the age gate in front of it: an alert dialog with two Tabs (a checkbox, or a date of birth in three selects) that works the age out against a fixed day, stores nothing, and unblurs the drawn page behind it when it passes.

  • Pro

    Account Locked Login

    Recovery and reset

    A 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

    Alert Banner Login

    Centered form

    A full-height sign-in page for a database host with a maintenance notice pinned above the form: a quiet alert with the window in UTC, a Details popover and a Dismiss that never moves the form.