Loading...
Installation
Props
Prop | Type | Default | Description |
---|---|---|---|
label | string | "Enter OTP" | The label for the OTP field |
length | number | 6 | Number of OTP digits |
separator | boolean | true | Show separator between digit groups |
onComplete | (otp: string) => void | undefined | Callback when OTP is complete |
Features
- Auto-Focus: Automatically moves to the next input when a digit is entered
- Paste Support: Handles pasted OTP codes and distributes digits automatically
- Backspace Navigation: Smart backspace behavior for easy editing
- Visual Separator: Optional separator line between digit groups
- Completion Callback: Triggers callback when all digits are entered
- Numeric Only: Accepts only numeric input (0-9)