Skip to content

FormOtp ​

A one-time code with one box per digit, paste support and automatic advance.

ts
import { FormOtp } from '@zairakai/vue-components/Form'

Usage ​

vue
<FormOtp />

Example ​

Code: …

vue
<script setup>
  import { ref } from 'vue'

  const code = ref('')
</script>

<template>
  <FormOtp
    v-model="code"
    :length="6"
  />
  <p>Code: {{ code || '…' }}</p>
</template>

Props ​

NameTypeDefaultDescription
idstring
classstring
modelValuestringundefined
lengthnumber6
patternRegExp() => /\d/The characters that are accepted: digits by default.
labelstring'Verification code'
digitLabelstring'Digit {n} of {total}'
namestring
formstring
disabledbooleanfalse
maskbooleanfalse

Events ​

NameDescription
update:modelValue
complete

See Theming for the class hooks and the data-* state of the components.

Documentation of 1.4.4 , built from 8e9b054 on 1.4.4 by pipeline #2989941079 on 2026-10-26.