input-otp

OTP input for PIN codes.

OTP input for PIN codes.

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

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

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

<template>
  <div class="flex items-center justify-center">
    <Field>
      <FieldLabel for="four-digits">4-Digit PIN</FieldLabel>
      <FieldDescription>Common pattern for PIN codes.</FieldDescription>
      <InputOTP id="four-digits">
        <InputOTPGroup>
          <InputOTPSlot :index="0" />
          <InputOTPSlot :index="1" />
          <InputOTPSlot :index="2" />
          <InputOTPSlot :index="3" />
        </InputOTPGroup>
      </InputOTP>
    </Field>
  </div>
</template>

Установка

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

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

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