Import
Usage
Props
Callback fired when all 6 digits are entered. The input automatically blurs after the 6th digit is typed, triggering this callback.
Error message displayed below the input in red text.
Disables input and reduces opacity to 0.5.
Automatically focuses the input when component mounts.
Custom CSS properties for the input container.
Custom CSS properties for the outer container wrapper.
Styling Details
- Font: DM Mono (monospace)
- Font size: 24px
- Letter spacing: 12px (creates separation between digits)
- Width: 160px
- Height: 56px
- Border radius: 12px
- Input type: Number (shows numeric keyboard on mobile)
- Placeholder:
"------"(6 dashes)
Behavior
- Auto-blur: Automatically blurs the input after 6 digits are entered
- Length validation: Only accepts exactly 6 digits, rejects additional input
- Number-only: Uses
type="number"with spinner arrows hidden - Focus styling: Blue 2px border on focus
- Error styling: Red 1px border when error prop is set
Examples
Basic Usage
With Verification Flow
With Custom Styling
Use Cases
- Email verification codes
- Two-factor authentication (2FA)
- SMS verification
- One-time passwords (OTP)
- PIN code entry