Input OTP
A one-time password input with individual character slots.
Generated from the package's public source.
API
Groupcomponent
Group(props: InputOTPGroupProps): Element
Props
class?stringstyle?string | CSSProperties
children: Element
InputOTPGroupPropsinterface
Props
class?stringstyle?string | CSSProperties
children: Element
InputOTPRootPropsinterface
Props
class?stringdefaultValue?string— Default value (uncontrolled).disabled?boolean— Whether the input is disabled.maxLengthnumber— Total number of characters.onComplete?(value: string) => void— Called when all slots are filled.onValueChange?(value: string) => void— Called when value changes.pattern?string— Regex pattern for allowed characters (e.g. "^[0-9]*$").style?string | CSSPropertiesvalue?Accessor<string | undefined>— Controlled value.
children: Element
InputOTPSlotPropsinterface
Props
class?stringindexnumber— Zero-based index of this slot.style?string | CSSProperties
Rootcomponent
Root(props: InputOTPRootProps): Element
Props
class?stringdefaultValue?string— Default value (uncontrolled).disabled?boolean— Whether the input is disabled.maxLengthnumber— Total number of characters.onComplete?(value: string) => void— Called when all slots are filled.onValueChange?(value: string) => void— Called when value changes.pattern?string— Regex pattern for allowed characters (e.g. "^[0-9]*$").style?string | CSSPropertiesvalue?Accessor<string | undefined>— Controlled value.
children: Element
Slotcomponent
Slot(props: InputOTPSlotProps): Element
Props
class?stringindexnumber— Zero-based index of this slot.style?string | CSSProperties