Input OTP
InputOTP handles multi-digit verification codes and OTP pin inputs.
Usage
import { useState } from 'react';import { InputOTP, InputOTPGroup, InputOTPSlot } from '@masumdev/rn-ui';
export function OTPExample() { const [value, setValue] = useState('');
return ( <InputOTP maxLength={4} value={value} onChange={setValue}> <InputOTPGroup> <InputOTPSlot index={0} /> <InputOTPSlot index={1} /> <InputOTPSlot index={2} /> <InputOTPSlot index={3} /> </InputOTPGroup> </InputOTP> );}Props API
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Current OTP digit value. |
onChange | (value: string) => void | — | Callback when digits are entered. |
maxLength | number | 4 | Total number of OTP digits. |