Verification Code Input

A component for inputting SMS verification codes, with support for sending codes and countdown display.

Component Examples

Basic Example

Basic usage example, showing the default verification code input.

300px

Preset Value

You can preset a verification code using the model-value property.

300px

Disabled Send Button

You can control the disabled state of the send button with the can-send property.

300px

Loading State

Show loading state during verification code sending.

300px

Countdown

Countdown starts automatically after sending a code, preventing frequent requests.

300px

Form Integration

Using the verification code input with a phone input in a form.

300px

Features

  • Integrated send code button
  • Countdown functionality
  • Automatic button state management
  • Loading state display
  • Can be used with phone input

Component Properties

PropertyDescriptionTypeDefault
idThe ID of the input field, defaults to 'verificationCode'stringverificationCode
model-value / v-modelThe bound value, verification code stringstring''
requiredWhether the field is requiredbooleanfalse
can-sendWhether sending verification code is allowedbooleantrue
loadingLoading state during send requestbooleanfalse
sent-atTimestamp when the verification code was sentnumber0
countdown-durationCountdown duration in seconds, default is 60number60

Component Events

EventDescriptionParameters
update:model-valueTriggered when the input value changes
:
:
:
:
:
:
send-codeTriggered when the send code button is clicked
No parameters
Design Empowers, Innovation Unlimited