Back to docs
Component
OTP Input
Verification input with one-cell-per-digit focus flow.
Install
npx shadcn@latest add @native-bits/otp-inputDependencies
react-native-reanimated
formsauthmobile
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| length | number | 6 | Number of input cells |
| onFilled | (code: string) => void | - | Triggered when all cells are filled |
| autoFocus | boolean | true | Focus first cell on mount |
Usage
```tsx
import { otp-input } from '@/components/native-bits/otp-input'
<OtpInput length={6} onFilled={verifyCode} />
```Source code
Loading...