OTP Input
An animated 6-digit OTP verification input with success/error states and smooth animations.
Install using CLI
npx shadcn@latest add "https://obsidianui.dev/r/otp-input.json"Install Manually
1
Install dependencies
2
Add util file
Create a file lib/utils.ts:
3
Copy the source code
Copy the code into components/ui/otp-input.tsx
Usage
Props
| Prop Name | Type | Default | Description |
|---|---|---|---|
| correctOTP | string | "424242" | The correct OTP code |
| onSuccess | () => void | - | Callback on success |
| onError | () => void | - | Callback on error |
