Tag input
Type and press Enter or comma to turn text into removable tags.
DesignReleasePerformance
Press Enter or comma to add.
When to use
- Topics, labels and keywords where people add their own values.
- Short, free-form lists.
When not to use
- The values come from a fixed list; use a multi-select.
- Order and structure matter; use a list editor.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/tag-input
Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
TagInput
10 props
PropTypeDefault
label *string—
valuereadonly string[]—
defaultValuereadonly string[][]
onValueChange((value: string[]) => void)—
placeholderstring"Add a tag"
descriptionstring"Press Enter or comma to add."
disabledboolean—
namestring—
idstring—
classNamestring—
Keyboard
- Enter
- Activates the focused control.
- Backspace
- Removes the previous character or item.
- ←
- Moves to the previous item or value.
- →
- Moves to the next item or value.
- Escape
- Closes or cancels, then returns focus to where it came from.
Accessibility
It exposes status semantics, with aria-label, aria-hidden and aria-describedby kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/tag-input.mdThe index of every part is at /llms.txt.