The value is a string[]. Enter, a comma, a paste, or leaving the field adds a tag. Add items for suggestions.
The sample also uses Field. One command adds them with this item:
topics-field.tsx
TagsInput
| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| value | readonly string[] | — | The tags. Use with onValueChange for a controlled Tags Input. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default | readonly string[] | — | The tags of an uncontrolled Tags Input. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on | — | Called with the new tags after an add, a remove, or Clear, and the Base UI change details (the Combobox details of a pick, a chip remove, or Clear; reason "none" for a typed add). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input | string | — | The typed text. Use with onInputValueChange for a controlled input. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default | string | "" | The typed text of an uncontrolled input. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on | — | Called when the typed text changes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| items | readonly string[] | — | Suggestions. With items the input is a combobox and a list opens below the frame; without them it is a plain text field. Tags already added leave the list. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| delimiters | readonly string[] | DEFAULT_TAGS_INPUT_DELIMITERS | Characters that add the typed text, as Enter does (default: comma). Enter always adds. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| add | boolean | true | Split a paste on the delimiters and on line breaks, and add each part (default: true). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| add | boolean | true | Add the typed text when focus leaves the field (Tab, a click outside; default: true). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trim | boolean | true | Remove the spaces around each tag (default: true). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| is | isSameTag | When two texts are the same tag (default: the same text with case ignored). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max | number | — | The most tags. At the max the input stays, so Backspace still reaches the tags. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| validate | — | A check of each new tag: return the message to show, or null to accept it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels | Partial<TagsInputLabels> | — | Every string the Tags Input says, to translate. Pass a stable object (module level or useMemo): a new object on each render rebuilds the context and re-renders every tag. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on | — | Called for each text that did not become a tag, with the reason and the message shown. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| children | ReactNode | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UICombobox.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name | string | — | Identifies the field when a form is submitted. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| form | string | — | Identifies the form that owns the internal input. Useful when the combobox is rendered outside the form. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id | string | — | The id of the component. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Enter | Adds the typed text as a tag, or picks the highlighted row. In an empty input, submits the form. |
|---|---|
| Comma | Adds the typed text as a tag. Set other keys with delimiters. |
| Tab | Leaves the field and adds the typed text as a tag, while addOnBlur is on. |
| Backspace | In an empty input, moves focus to the last tag. |
| Left Arrow | At the start of the text, moves focus to the last tag. Right to left uses Right Arrow. |
| Left ArroworRight Arrow | Moves focus between the tags. |
| BackspaceorDelete | On a tag, removes it. A held key removes one tag. |
| Escape | With the list closed, clears the typed text. |
- ComboboxType to filter a list, then pick one value or several as chips. The value is always one of the items, so it works as a select with search.
- Tag GroupPick Tag Group to show a set of tags that people read, remove, or pick as filters, with no typing.
- InputA field for one line of text, such as a name or an email address. It comes in the 3 sizes of Button, with invalid, disabled, and read-only states.
Built with
Installs with Tags Input
- Components
- Combobox





