Tags Input
stableAn input that collects a list of tags as chips.
Basic usage
reacttailwind
Examples
Controlled with max tags
Cap the tag count and track the value externally.
reacttypescript
2/5 tags
Tag collection
TagsInput supports existing tags, rendered chips, input entry and max-tag workflows.
reacttailwindstorybook
Features
- Delimiter parsing.
- Paste-split, max-tags.
Installation
bash
pnpm dlx structyl add tags-inputAPI Reference
TagsInput.Root
A tag input with chips.
| Prop | Type | Default |
|---|---|---|
| value | string[]Controlled tags. | — |
| onValueChange | (tags: string[]) => voidCalled when tags change. | — |
| delimiters | string[]Keys that commit a tag. | [',', 'Enter'] |
| maxTags | numberMaximum number of tags. | — |
| duplicateTags | booleanAllow duplicate tags. | false |
TagsInput.Input
The text input.
| Prop | Type | Default |
|---|
TagsInput.Tag
A single chip.
| Prop | Type | Default |
|---|---|---|
| index | numberThe tag index. | — |