Skip to content

OtpInput

EOtpInput (a one-time password) is a number or alphanumeric string of characters produced automatically to authenticate a user for a single transaction or login.Demo Here

Usage

vue

<template>
  <EInput v-model="value" label="Enter the code"/>
</template>

<script setup>
  const value = ref("");
</script>

Props

For EOtpInput component, the following props are available:

PropTypeDefaultNote
labelString-Component's label
idString-HTML id attribute.
disabledBooleanfalseDisables the EOtpInput.
variantString"fill"The EOtpInput element can be represented in four ways: fill and border.
widthString-Sets the component's width.
heightString-Sets the component's height.
squareBooleanfalseRemoves rounded corners of the element.
messageString-Adds a message below the input.
digitsLengthNumber6Specify the length of the OTP Input.
pasteBooleanfalseEnables the user to paste one output to multiple OTP.
nameString-HTML name attribute.
validateOnString"input"Triggers validation on @values: submit, input, blur.
rulesArray-Validation rules. For more info refer to Form Validation.
stateString-Validates the user-provided data against established criteria and performs display validation. States can be none if no validation is necessary, danger if the selected is valid, or success if it is acceptable.
readOnlyBooleanfalseSame as readonly in native OTP makes the element not mutable.
sizeString"md"The EOtpInput element has three predefined sizes: sm, md, lg.
alignString"start"Specifies how the pagination buttons are distributed along the cross axis in a container.
colorString"primary"The given color is applied to the element - utility colors are supported (e.g primary or danger). you'll find a list of built-in classes on the src/styles/_vars.scsspage.

Emits

The EOtpInput component contains following emits.

EmitDescription
update:modelValueControls the input.
blurIt binds to the component's onblur event.
focusIt binds to the component's onfocus event.

COPYRIGHT