useOtpInput
Handle OTP boxes, pasting, and focus movement.
useOtpInput.tsx
import { useOtpInput } from "@cermuel/hooks/react";export function useOtpInputExample() { const otp = useOtpInput(6); return <p>{otp.value}</p>;}Props
Param
Type
Default Value
lengthnumberReturns
{ digits: string[]; value: string; complete: boolean; setDigit: (index: number, value: string) => void; paste: (value: string) => void; clear: () => void; }