Skip to content

InputOTP

Overview

A styled OTP (one-time password) input built on vue-input-otp's OTPInput, with slot forwarding for custom slot rendering.

Theme entry: InputOTP

Props

NameTypeRequiredDefaultDescription
themeOverrideString|Object|ArraynullA partial theme object merged with the component's default theme; accepts a class string, class array, or theme object.
classstring|array|objectundefinedAdditional CSS classes to apply to the container element.
modelValuestringundefinedThe controlled value (used with v-model).
maxlengthnumberyesThe maximum length (number of OTP slots). Required.
textAlignstringundefinedText alignment of characters within slots.
inputmodestringundefinedInput mode for the underlying input element.
pushPasswordManagerStrategystringundefinedStrategy for handling password manager icon placement.
noScriptCssFallbackstringundefinedCSS fallback string injected via noscript for browsers without JS.
defaultValuestringundefinedThe default value when uncontrolled.
pasteTransformerfuncundefinedA function to transform pasted text before applying it.

Slots

default

Scoped slot.

Events

NameDescription
update:modelValueEmitted when the value changes.
completeEmitted when all slots are filled.
changeEmitted when the value changes.
selectEmitted when an item is selected.
inputEmitted on each keystroke.
focusEmitted when the input gains focus.
blurEmitted when the input loses focus.
mouseoverEmitted when the pointer enters the element.
mouseleaveEmitted when the pointer leaves the element.
pasteEmitted when the user pastes into the input.

Full event reference

Source

client/lib/controls/input-otp/InputOTP.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2