OTPInput API

API reference docs for theOTPInputcomponent. For examples and details on the usage of this component, visit the component demo page.

Props

PropTypeDescriptionDefault
value?stringControlled value of the OTP input.''
length?4 | 5 | 6 | 7 | 8Number of input fields.6
mode?'numeric' | 'alphanumeric'Input mode - numeric allows only numbers, alphanumeric allows letters and numbers.'numeric'
autoFocus?booleanAuto-focus first input on mount.false
onChange?(value: string) => voidCallback when value changes._
onComplete?(value: string) => voidCallback when all fields are filled._
size?'standard' | 'large'Size of the OTP input fields.'standard'
labelstringLabel for the OTP input field group. It will be visually hidden by default._
errorMessage?stringError message to display below the input._