Components/Inputs/PinInput

PinInput

Inputs

Multi-cell OTP / PIN entry with automatic focus advancement.

Renders length individual input boxes that auto-advance focus on character entry. Supports numeric or alphanumeric input, masking for sensitive values, and paste-to-fill.

Usage

import { PinInput } from "nosible-ux"

export default function Example() {
  return <PinInput length={6} label="Verification code" onComplete={(v) => console.log(v)} />
}

Examples

OTP entry

Masked PIN

Accessibility

Each box is a text input with inputMode="numeric" (or text for alphanumeric). Arrow keys navigate between boxes. Paste fills from the current box onward.

Props

Name TypeDefaultDescription
defaultValue
string | undefinedUncontrolled initial value.
disabled
boolean | undefined
error
string | undefinedValidation error text.
label
string | undefinedLabel rendered ALL-CAPS in Space Mono above the input group.
length
number | undefined6Number of digit/character boxes.
mask
boolean | undefinedfalseWhen true, renders bullets instead of the typed character (like a password).
onChange
((value: string) => void) | undefinedCalled with the full current string on every change.
onComplete
((value: string) => void) | undefinedCalled with the complete code when all boxes are filled.
placeholder
string | undefined"○"Placeholder character shown inside each empty box.
size
"sm" | "md" | "lg" | undefined"md"Visual size.
type
"number" | "alphanumeric" | undefined"alphanumeric"Input type constraint.
value
string | undefinedControlled value string (length ≤ `length`).