InputOtp beta

Used to enter a one-time password (OTP).

Uso Básico

Value: 123

Custom Length

The length of the input fields can be customized by setting the length prop.

Tipos

There are three types available: outlined (default), filled, and underlined.

Outlined (Default)

Filled

Underlined

Tamaño

There are three sizes available: large, default, and small.

Large

Default

Small

Disabled & Readonly

Disabled and readonly states are supported.

Disabled

Readonly

Mask

Use the mask prop to hide the input characters.

Value: 123

Separator

Customize the separator between OTP fields.

/////

Custom Validation

Set the validator prop to validate the input character, and use inputmode to specify the keyboard type.

Numbers only

Letters only

API

Personalizable

NombreDescripciónParámetrosValore por defecto
model-value / v-modelThe value of the OTP fields. Since numbers must not have leading zeros, modelValue is allowed to be a number only during initialization.string / numberundefined
lengthThe OTP fields lengthnumber6
validatorCustom validator functionFunction() => true
inputmodeNative inputmode attributestring
tipoThe type of the OTP fieldsenum'outlined'
sizeThe size of the OTP fieldsenum'default'
maskWhether to enable password modeboolean
disabledWhether the OTP fields are disabledbooleanundefined
separatorThe separator between OTP fieldsstring / VNode / Function
validate-eventWhether to trigger form validationbooleantrue
readonlySame as readonly in native inputbooleanfalse
idNative id attributestring
aria-label a11yNative aria-label attributestring

Slot

NombreDescripciónParámetros
update:modelValueTriggers when value updatesFunction
changeTriggers when the value changes after input blurFunction
finishFires when all fields have been filledFunction
focusTriggers when input is focusedFunction
blurTriggers when input is blurredFunction

Slots

NombreDescripciónParámetros
separatorThe separator between OTP fieldsobject

Expuesto

NombreDescripciónParámetros
inputRefsHTML input elements arrayobject
focusFocus an OTP input fieldFunction
blurBlur the focused OTP input fieldFunction

Fuente

ComponentesStyleDocumentación

Contribuidores