PIN Input
Masked boxes for entering a secret PIN.
- Status
- ReadyBuild day 19 of 21
- Code
- In React
- Role
- Form
Usage
This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.
Never share your PIN with anyone
Pastes as editable layers. Shadows are not exported.
import { useState } from "react";
import { PinInput } from "@/ui";
export default function PinDemo() {
const [pin, setPin] = useState<string>("");
return <PinInput label="Enter transaction PIN" value={pin} onChange={setPin} hint="Never share your PIN with anyone" />;
}Variants and states
Every specimen is the real component from src/ui, held in one state.
Never share your PIN with anyone
Never share your PIN with anyone
Incorrect PIN. 2 attempts left.
Never share your PIN with anyone
Never share your PIN with anyone
Never share your PIN with anyone
Incorrect PIN. 2 attempts left.
Never share your PIN with anyone
Pastes as editable layers. Shadows are not exported.
Props
- label
- string · default none
- Required.
- length
- 4 | 6 · default 6
- value, onChange
- string, (value) => void · default none
- A keypad outside the component can call onChange.
- onComplete
- (value) => void · default none
- Called at full length.
- hint, error
- string · default none
- showLabel
- boolean · default true
- disabled
- boolean · default none
Figma to code
Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.
- 🔀 Count
- length
- 4 or 6 Digit.
- 🎯 State
- value, error, disabled
- Filled is the dot count.
- Show Label, Label
- showLabel, label
- Same.
- Show Helper Text, Helper Text
- hint
- Pass to show.
Accessibility
What the code in src/ui does today, and what it leaves to you.
Keyboard
- A real password input sits over the dots, so the system keyboard works and Tab reaches it.
Screen readers
- Named by the label. The value is never shown or read. The helper line is a polite live region, so an error is announced.
What you still need to do
- The numeric keypad lives outside this component. Give its buttons names, and its delete button the name Delete.
When to use
Authorizing a transaction or unlocking an app.
Do and don't
Do
- Mask each digit after it is entered.
- Use a numeric keyboard on mobile.
Don't
- Show the PIN in plain text by default.
- Store or log the entered digits.
Related
4 of 16 other atoms, same role and ready ones first.
- CheckboxLets users select one or more options from a set.Ready
- OTP InputBoxes for entering a one-time code sent by SMS or email.Ready
- Radio ButtonA single option that belongs to a set where only one can be chosen.Ready
- SliderPicks a value from a continuous range by dragging.Ready
Status reflects the component tracker snapshot of 29 October 2026.