Install
Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):
npx shadcn-vue@latest add https://beehexa.design/r/pin-input.json
Use
<script setup lang="ts">
import { ref } from 'vue'
import { PinInput, PinInputGroup, PinInputSlot } from '@/components/ui/pin-input'
const pin = ref<string[]>([])
</script>
<template>
<div>
<PinInput v-model="pin" aria-label="PIN">
<PinInputGroup>
<PinInputSlot v-for="(_, i) in 4" :key="i" :index="i" />
</PinInputGroup>
</PinInput>
</div>
</template>
Props
| Part | Prop | Values | Notes |
|---|---|---|---|
PinInput |
v-model, type, mask |
string[], text/number, boolean |
|
PinInputSlot |
index |
number |
Built on
reka-ui PinInputRoot and PinInputInput, as the shadcn-vue Pin input.