DDS/Components/TagInput

TagInput

Form

Input that creates tags/labels as you type.

Props

PropTypeDefaultDescription
modelValuestring[][]Current tags (v-model).
placeholderstring"Add tag…"Input placeholder.
disabledbooleanfalseDisable the component.
maxnumberundefinedMaximum number of tags.
allowDuplicatesbooleanfalseAllow duplicate tags.

Examples

Type and press Enter to add tags
Nuxt Vue 3
vue
<script setup>
const tags = ref(['Nuxt', 'Vue 3'])
</script>
<template>
  <DsTagInput v-model="tags" placeholder="Add a tag and press Enter…" :max="5" />
</template>

Skeleton

Use DsTagInputSkeleton as a loading placeholder while content is being fetched.

Default
vue
<DsTagInputSkeleton />

Accessibility

  • Press Enter to add a tag.
  • Backspace on empty input removes the last tag.
  • Each tag has a remove button with aria-label.