Tags Input

Free-form tag entry. Type, press Enter or comma, get a chip. Backspace removes the last chip.

Default

Pre-seeded list of tags.

Dark previewReplay previewOpen in new tab
vue
nuxt
tailwind

Usage

Import the parts you need from the component's folder.

ts
import {
  TagsInput,
  TagsInputInput,
  TagsInputItem,
  TagsInputItemDelete,
  TagsInputItemText,
} from "@/components/ui/tags-input";

With delimiter

Set delimiter to commit a tag on a different key (here, space).

Dark previewReplay previewOpen in new tab
one

Disabled

Pass disabled to block adding or removing tags.

Dark previewReplay previewOpen in new tab
vue
nuxt

API Reference

TagsInput

PropTypeDefaultDescription
modelValuestring[][]Current tags. Supports v-model.
addOnPastebooleanfalseAuto-split pasted content on commas/newlines into tags.
duplicatebooleanfalseAllow duplicate tags.
delimiterstring | RegExp","Separator that splits typed input into tags.
EventDescription
update:modelValueFires when tags are added or removed. Enables v-model.
add-tagFires with the value of a newly added tag.
remove-tagFires with the value of a removed tag.

TagsInputItem / TagsInputItemText / TagsInputItemDelete

PropTypeDefaultDescription
valuestring—(TagsInputItem) The tag this chip represents. ItemText renders the label; ItemDelete is the remove button.

TagsInputInput

PropTypeDefaultDescription
placeholderstring—Placeholder for the free-text entry field.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
EnterAdds the typed text as a new tag.
BackspaceRemoves the last tag when the input is empty.
←Moves focus to the previous tag.
→Moves focus to the next tag.
DeleteRemoves the focused tag.
  • A comma also commits the typed text as a new tag.
  • Each tag is focusable and can be removed individually.
  • The field is labelled with role-appropriate ARIA so additions and removals are announced.