OtpInput

The OtpInput component provides an easy way to implement input fields for multi-digit one-time passwords (OTP) or verification codes. It is designed to handle the input of sequential digits, enabling seamless user experiences for forms requiring OTP input.

Basic

Basic usage of OtpInput

Length

OtpInput can adapt to different OTP lengths using the length prop

API

FormNumericInput
PropDescriptionTypeDefault
autoFocusWhether the Input is focused automaticallyboolean-
disabledWhether the Input is disabledboolean-
invalidWhether the Input is invalid statusboolean-
inputClassClass for all input fieldsstring-
lengthLength of input fieldnumber-
onChangeCallback when Input value changed(value: string) => void-
placeholderPlaceholder text for all input fieldsstring-
valueControlled Input valuestring-