input-otp

OTP input with letters and numbers.

OTP input with letters and numbers.

Загрузка превью…

src/input-otp/c-input-otp-4.vue

<script setup lang="ts">
import { Field, FieldDescription, FieldLabel } from "@/components/ui/field"
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "@/components/ui/input-otp"
</script>

<template>
  <div class="flex items-center justify-center">
    <Field>
      <FieldLabel for="alphanumeric">Alphanumeric OTP</FieldLabel>
      <FieldDescription>Accepts both letters and numbers.</FieldDescription>
      <InputOTP id="alphanumeric">
        <InputOTPGroup>
          <InputOTPSlot :index="0" />
          <InputOTPSlot :index="1" />
          <InputOTPSlot :index="2" />
        </InputOTPGroup>
        <InputOTPSeparator />
        <InputOTPGroup>
          <InputOTPSlot :index="3" />
          <InputOTPSlot :index="4" />
          <InputOTPSlot :index="5" />
        </InputOTPGroup>
      </InputOTP>
    </Field>
  </div>
</template>

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-input-otp-4.json

Зависимости реестра

Источник: порт из ReUI (Keenthemes, MIT)