Appearance
InputOTP
Ô nhập OTP phân đoạn.
ts
import { InputOTP, InputOTPGroup, InputOTPSlot } from "@minap/ui";Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import { InputOTP, InputOTPGroup, InputOTPSlot } from "@minap/ui";
export function Example() {
return (
<>
<InputOTP maxLength={4}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
</InputOTPGroup>
</InputOTP>
</>
);
}Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
maxLength | number | — | Số slot bắt buộc |
disabled | boolean | false | |
value / onChange | controlled | — | API input-otp |
Behavior
- Slot kích thước touch
- InputOTPSeparator