OTPInput
Forms

OTPInput.

A grouped verification code input supporting paste and autofill.

Real interactive component
Live demo

0 of 6 digits entered

The preview uses the actual shared component, including your current theme, rounding, border and motion preferences.

Props & API reference

Parameters available in the shared component, including value types, requirements and accepted options.

7 props
ParameterTypeRequiredDefaultPossible valuesDescription
valuestringYes——Controlled numeric verification code.
onValueChange(digits: string) => voidNo——Called as digits are entered or pasted.
lengthnumberNo6—Expected digit count (1–12).
labelstringNoVerification code—Accessible field name.
onComplete(code: string) => voidNo——Fires when the code reaches full length.
disabledbooleanNofalsetrue · falseDisable code input.
classNamestringNo——Additional CSS class on the outer component element.