OPUS/UI

Navigation

Tag Input

Chips input — Enter, comma or paste to add, Backspace to edit the last chip, validation, max count and suggestions.

4 files · 328 locdeps: clsx, tailwind-merge
reacttailwind

Enter, comma or paste a list. Backspace edits the last chip.

Validated, max 5.

Installation

With the shadcn CLI, pointing at this platform’s registry:

npx shadcn@latest add https://opusui.131199999.xyz/r/tag-input.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs tag-input

Usage

import { TagInput } from "@/components/opus/ui/tag-input";

<TagInput value={tags} onValueChange={setTags} suggestions={topics} />

API

PropTypeDefaultDescription
value / defaultValue / onValueChangestring[]—Tags.
validate(t) => boolean | string—Reject with a message.
maxnumber—Max tags.
suggestionsstring[]—Autocomplete list.
separatorsstring[]["Enter", ",", "Tab"]Commit keys.

Command palette