Back to docs
Component

OTP Input

Verification input with one-cell-per-digit focus flow.

Install

npx shadcn@latest add @native-bits/otp-input

Dependencies

react-native-reanimated
Try in Sandbox
formsauthmobile

Props

PropTypeDefaultDescription
lengthnumber6Number of input cells
onFilled(code: string) => void-Triggered when all cells are filled
autoFocusbooleantrueFocus first cell on mount

Usage

```tsx
import { otp-input } from '@/components/native-bits/otp-input'

<OtpInput length={6} onFilled={verifyCode} />
```

Source code

Loading...