Tags Input

Keyboard-friendly input that collects values as removable tags.

Tags Input

Keyboard-friendly input that collects values as removable tags.

Preview

react
shadcn

Features

  • Enter or comma adds a tag; Backspace removes the last one.
  • Arrow keys move between tags.
  • Optional minItems and maxItems.

Installation

npx shadcn@latest add https://www.shadcn-form.com/r/tags-input.json

The CLI installs every dependency listed in the registry item.

Usage

import { TagsInput } from '@/components/ui/tags-input'
const [tags, setTags] = React.useState<string[]>([])
<TagsInput value={tags} onValueChange={setTags} placeholder="Add a tag" />