Tags
Tags are a way to apply multiple labels to an item.
Installation
bash
npx shadcn@latest add @redpanda/tagsbash
pnpm dlx shadcn@latest add @redpanda/tagsbash
yarn dlx shadcn@latest add @redpanda/tagsbash
bunx shadcn@latest add @redpanda/tagsbash
nubx shadcn@latest add @redpanda/tagsbash
aube dlx shadcn@latest add @redpanda/tagsWhen to use
Tags provide a way to apply multiple labels to items. Use this decision tree:
Features
- Built-in search input to filter through tags
- Supports both controlled and uncontrolled usage
- Caller-owned layout through
className; shared recipes own control appearance - Automatically adjusts width based on parent container
- Optional remove button for selected tags
- Full keyboard navigation support through
Commandcomponent - Shared state management through
TagsContext
Examples
Removable values
Provide an item-specific action name whenever onRemove is present. Values without
removal do not accept removeLabel. Keyboard removal returns focus to the picker
without opening it.
tsx
<TagsValue onRemove={removeReact} removeLabel="Remove React"> React</TagsValue>Removal actions use the standard destructive-ghost icon Button. Its larger target intentionally increases chip height compared with the old miniature custom button.
Default
Filter
Credits
- We use Kibo UI for the tags component and style.