v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS
TagInput
Editable token lists with a keyboard-first input.
Interactive preview
Usage
import { TagInput } from "@devvy-ui/react";
<TagInput label="Project tags" name="tags" defaultValue={['design']} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue | readonly string[] | [] | Selected tags. |
| onValueChange | (tags: string[]) => void | — | Tag changes. |
| maxTags | number | 20 | Maximum accepted tags. |
Accessibility & behavior
Platform Behavior & Guidelines
Enter/comma add, formatted paste adds several tags, Backspace removes the last empty-input tag, and named removal buttons work on touch. Duplicate values are ignored.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add tag-inputMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
TagInput.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.