Skip to content

Input OTP ​

Use bo-input-otp for short verification codes. It supports individual entry, arrow-key navigation, and paste.

Usage ​

Enter the code sent to your email.
Waiting for code
<bo-input-otp>
  v-model="code"
  :length="6"
  label="Verification code"
  hint="Enter the code sent to your email."
  @complete="completed = $event"
/>

Password mode ​

Set type="password" when entered characters should be hidden.

<bo-input-otp v-model="code" type="password" :length="4" label="Recovery code" />

API ​

Prop / eventTypeDefaultDescription
id / dataTestIdstringautogeneratedRoot and cell attributes.
modelValuestring''Complete string used by v-model.
lengthnumber6Number of cells.
typetext | passwordtextWhether entered characters are hidden.
pattern / inputModestring / native input mode[0-9] / numericCharacter validation and keyboard hint.
namestring-Hidden native form field name.
label / description / error / hintstring-Field messaging.
required / disabled / readOnly / autofocusbooleanfalseInput states and initial focus.
role / ariaLabel / ariaLabelledBy / ariaDescribedBynative accessibility typesgroup / -Group and cell semantics.
update:modelValueevent-Emitted when the code changes.
complete(value: string) event-Emitted when every cell has a value.
focus / blurevent-Emitted by the individual cells.
focusexposed method-Focuses the first cell.

Released under the MIT License.