Tags input also Tag input, Chips input, TagsInput
Free-form tags with the suggestions in view (Mantine's TagsInput; to pick from a fixed list, ray-combobox): what is typed becomes a tag on Enter, a comma or leaving the field; the suggestions are buttons under the field, filtered as you type, one click adds one. No dropdown, so on a phone nothing opens over the field when the keyboard comes up.
Add or remove tags: the value shows here.
API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-tags-input> · RayTagsInput
A text field that keeps tags as chips, and its suggestions (child <option> elements or data) as buttons under it. Typing filters them, case and accents aside ("diabe" finds "Diabetes"); the ones already chosen are left out. Pressing a suggestion while typing keeps the focus in the field, so the phone's keyboard stays up. Enter, a separator (a pasted "a, b, c" adds three) or leaving the field adds what was typed, anything at all; no two tags are the same, case and accents aside. Backspace in an empty field removes the last tag, Escape clears the text. The form gets one entry per tag. For a fixed list to pick from, use ray-combobox multiple.
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value (initial) | array | The tags. The value attribute: "a,b". A string "a,b" assigned to the property is read as a list too. | |
data | — | array | Suggestions instead of child <option> elements. | |
placeholder | placeholder | string | Shown while there are no tags. | |
max | max | number | At most this many tags; when reached, nothing more is added and the suggestions hide. | |
suggestionsLimit | suggestions-limit | number | 6 | At most this many suggestions shown (keep typing for the rest); 0 shows them all. |
suggestionsLabel | suggestions-label | string | Suggestions (text tags-input.suggestions) | The accessible name of the group of suggestions. |
separators | separators | string | , | Characters that end a tag as they are typed or pasted (",;" for both); "" for none (Enter and leaving the field still add). |
| Event | Description |
|---|---|
change | A tag was added or removed (read value). |
input | Same moment as change. |
| Slot | Description |
|---|---|
| (default) | <option> elements: the suggestions (the text is the tag; value, if different, is what the tag stores). |
| Part | Description |
|---|---|
input | The text field. |
tags | The tags container. |
tag | A tag. |
tag-remove | A tag's remove button. |
suggestions | The group of suggestions under the field. |
suggestion | A suggestion button. |
Texts
What it writes itself, in English; setStrings() translates them (Getting started: Languages).
| Key | English |
|---|---|
tags-input.remove | Remove {label} |
tags-input.suggestions | Suggestions |