vael-ui v0.3.10

Forms & Inputs

OtpInput

A row of single-character boxes for one-time codes, with paste and auto-advance.

Install

import { OtpInput } from 'vael-ui'

Playground

import { OtpInput } from 'vael-ui'

<OtpInput :length="6" type="numeric" :mask="false" :disabled="false" :invalid="false" size="md" name="">OtpInput</OtpInput>

Props

NameTypeDefaultDescription
lengthnumber | undefined6
type"numeric" | "alphanumeric""numeric"Restricts input to digits only or alphanumeric.
maskboolean | undefinedfalseShows a bullet instead of the entered character in every filled cell.
disabledboolean | undefinedfalse
invalidboolean | undefinedfalse
size"md" | "sm" | "lg""md"
namestring | undefined
uiPartial<{ root: UiPartValue; input: UiPartValue; cell: UiPartValue; }> | undefined
modelValuestring | undefined""

Slots

NameTypeDescription
cell{ char: string | null; index: number; active: boolean; filled: boolean; }Custom content for one cell.

Events

NameTypeDescription
update:modelValue[value: string]
complete[code: string]

Exposed

NameTypeDescription
elHTMLElement | null
inputElHTMLInputElement | null
cellElsHTMLElement[] | null