Input OTP
Base UIA grouped input for one-time verification codes.
ReadyResponsive
Usage
Package export"use client"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@jnpll/elements-ui/input-otp"
export function InputOTPDemo() {
return (
<InputOTP maxLength={6} defaultValue="123456">
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
)
}
export default InputOTPDemo;
Examples
Disabled state
1
2
3
4
5
6
API Reference
| Prop | Type / description | Default |
|---|---|---|
disabled | booleanDisables the control. | false |
value / defaultValue | stringControlled or initial input value. | - |
className | stringAdditional classes, merged with the component styles. | - |
Composition & accessibility
Import the composition slots shown in the example. Keep labels and descriptions meaningful; interactive primitives provide keyboard and focus behavior. See the source for the complete typed API.