Usage
Props
Number of character input cells to display.
Controlled value of the PIN (all characters combined).
Default value for uncontrolled mode.
Called when any character changes. Receives the current PIN string.
Called when all cells are filled. Receives the complete PIN string.
Input type validation:
number: Only digits 0-9alphanumeric: Letters and numbers
Masks input as password (shows dots instead of characters).
Disables all input cells.
Applies error styling to all cells.
Size variant:
sm: size-8, text-smmd: size-10, text-baselg: size-12, text-lg
Character displayed in empty cells.
Enables autocomplete for SMS one-time codes.
Additional CSS classes to apply to the container.
HTML ID attribute. Auto-generated if not provided.
Examples
Basic PIN Input
6-Digit OTP
Masked PIN Entry
Different Sizes
With Error State
Alphanumeric Code
Verification Code Form
Keyboard Behavior
- Type character: Fills current cell and auto-focuses next
- Backspace: Clears current cell, or moves to previous if empty
- Arrow Left/Right: Navigate between cells
- Paste: Distributes pasted content across all cells
- Select: Auto-selects content on focus
Notes
- Each cell is a separate input for better UX
- Paste support on first cell distributes characters across all cells
- Auto-focus moves to next cell on input
- Backspace behavior: delete current or move to previous
- Font uses monospace for consistent character width
oneTimeCodeautocomplete helps with SMS verification codes- Type validation prevents invalid characters
onCompletefires only when all cells are filled- Error state applies red border to all cells