Get StartedComponentsStylingThemingMath & Science
MCP

Forms

Input OTP

One-time-code input with paste and SMS autofill support, no dependencies.

Markdown

Import

tsx
import { InputOTP } from "@indoku/ui"

Examples

Basic usage

Value: (kosong)

Props

Root

PropTypeDefaultDescription
maxLength*number–
valuestring–
defaultValuestring–
onChange(value: string) => void–
onComplete(value: string) => void–Called as soon as every slot is filled.
patternRegExpdigits onlyAllowed characters (tested per character). Use REGEXP_ONLY_DIGITS, REGEXP_ONLY_CHARS or REGEXP_ONLY_DIGITS_AND_CHARS.
disabledboolean–
invalidboolean–
inputMode"numeric" | "text" | "tel" | "decimal" | "email" | "search" | "url" | "none"–Virtual keyboard hint. Defaults to numeric for the digits pattern, otherwise text.
namestring–
autoFocusboolean–

Slot

PropTypeDefaultDescription
index*number–

* required. Style props and HTML attributes are accepted as well.

Created by @indokudev