Toggle Sidebar B
header.lightDarkMode D

Input OTP

One-time password input with per-character slots. Used for 2FA, email verification, and sign-in codes. Built on vue-input-otp.

Default

Six-digit OTP.

With separator

Split slots into groups for readability.

Controlled

Bind v-model and read the value back as it's typed.

Entered: nothing yet

API Reference

Props, events, and slots for each sub-component.

InputOTP

Props

PropTypeDefaultDescription
modelValuestringCode value. Supports v-model.
maxlengthnumber6Total number of slots.
patternstringRegex pattern for allowed characters.
disabledbooleanfalseDisable input.

Events

EventDescription
completeFires when all slots are filled with valid characters.
update:modelValueFires as characters are entered. Enables v-model.

Slots

SlotDescription
defaultScoped slot exposing { slots } so you can render the groups and per-slot state.

InputOTPSlot

Props

PropTypeDefaultDescription
indexnumberPosition of this slot within the code (0-based).

InputOTPGroup / InputOTPSeparator

Props

PropTypeDefaultDescription
classstringGroup wraps a run of slots; Separator draws a divider (default slot overrides the dash).