Skip to content

Pin Input ​

Allows users to enter a sequence of one-character alphanumeric inputs.

Examples ​

Default ​

vue
<script setup>
import { ref } from 'vue'
import {
  PinInput,
  PinInputGroup,
  PinInputSeparator,
  PinInputSlot
} from '@empathyds/vue'

const value = ref([])
</script>

<template>
  <PinInput v-model="value" placeholder="○">
    <PinInputGroup>
      <PinInputSlot :index="0" />
      <PinInputSlot :index="1" />
      <PinInputSlot :index="2" />
      <PinInputSlot :index="3" />
    </PinInputGroup>
  </PinInput>
</template>

Props ​

PinInput ​

PropTypeDefaultDescription
modelValuestring[]-The controlled value of the pin input.
defaultValuestring[]-The default value.
placeholderstring-The placeholder character.
otpbooleanfalseWhether the input is for OTP.
typetext | numbertextThe type of the input.
maskbooleanfalseWhether to mask the input.

Slots ​

PinInput ​

SlotDescription
defaultThe content of the pin input.

PinInputGroup ​

SlotDescription
defaultThe content of the group.

PinInputSlot ​

SlotDescription
defaultThe content of the slot.