UIPackage
Menu

Framework

Change language

Boilerplate repo

Tags Input

tags-inputui

Multi-tag input — type a value, hit Enter, get a Chip. Backspace removes the last tag. Use for email recipient lists, tag sets, and free-form keyword inputs.

Also available for React ->

Installation

$npx shadcn-vue@latest add https://uipkge.dev/r/vue/tags-input.json
Named registry:npx shadcn-vue@latest add @uipkge/tags-inputInstalls to:app/components/ui/tags-input/

Examples

Loading interactive previews…

Props

NameType / ValuesDefaultRequired
classHTMLAttributes['class']optional

Files installed (6)

  • app/components/ui/tags-input/TagsInput.vue1.1 kB
    <script setup lang="ts">
    import type { TagsInputRootEmits, TagsInputRootProps } from 'reka-ui'
    import type { HTMLAttributes } from 'vue'
    import { reactiveOmit } from '@vueuse/core'
    import { TagsInputRoot, useForwardPropsEmits } from 'reka-ui'
    import { cn } from '@/lib/utils'
    
    const props = defineProps<TagsInputRootProps & { class?: HTMLAttributes['class'] }>()
    const emits = defineEmits<TagsInputRootEmits>()
    
    const delegatedProps = reactiveOmit(props, 'class')
    
    const forwarded = useForwardPropsEmits(delegatedProps, emits)
    </script>
    
    <template>
      <TagsInputRoot
        v-slot="slotProps"
        v-bind="forwarded"
        data-uipkge
        data-slot="tags-input"
        :class="
          cn(
            'border-input bg-background flex flex-wrap items-center gap-2 rounded-md border px-2 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none',
            'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]',
            'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
            props.class,
          )
        "
      >
        <slot v-bind="slotProps" />
      </TagsInputRoot>
    </template>
    
  • app/components/ui/tags-input/TagsInputInput.vue0.7 kB
  • app/components/ui/tags-input/TagsInputItem.vue0.8 kB
  • app/components/ui/tags-input/TagsInputItemDelete.vue0.9 kB
  • app/components/ui/tags-input/TagsInputItemText.vue0.7 kB
  • app/components/ui/tags-input/index.ts0.3 kB

Raw manifest:https://uipkge.dev/r/vue/tags-input.json