Import
tsx
import { InputOTP } from "@indoku/ui"Examples
Basic usage
Value: (kosong)
tsx
Props
Root
| Prop | Type | Default | Description |
|---|---|---|---|
maxLength* | number | – | |
value | string | – | |
defaultValue | string | – | |
onChange | (value: string) => void | – | |
onComplete | (value: string) => void | – | Called as soon as every slot is filled. |
pattern | RegExp | digits only | Allowed characters (tested per character). Use REGEXP_ONLY_DIGITS, REGEXP_ONLY_CHARS or REGEXP_ONLY_DIGITS_AND_CHARS. |
disabled | boolean | – | |
invalid | boolean | – | |
inputMode | "numeric" | "text" | "tel" | "decimal" | "email" | "search" | "url" | "none" | – | Virtual keyboard hint. Defaults to numeric for the digits pattern, otherwise text. |
name | string | – | |
autoFocus | boolean | – |
Slot
| Prop | Type | Default | Description |
|---|---|---|---|
index* | number | – |
* required. Style props and HTML attributes are accepted as well.
Created by @indokudev