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.

Source on GitHub

Suggestions under the field: type to filter, click to add, or type anything and press Enter

Add or remove tags: the value shows here.

In a form, sizes and states
Submit
Code

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.

PropertyAttributeTypeDefaultDescription
valuevalue (initial)arrayThe tags. The value attribute: "a,b". A string "a,b" assigned to the property is read as a list too.
data—arraySuggestions instead of child <option> elements.
placeholderplaceholderstringShown while there are no tags.
maxmaxnumberAt most this many tags; when reached, nothing more is added and the suggestions hide.
suggestionsLimitsuggestions-limitnumber6At most this many suggestions shown (keep typing for the rest); 0 shows them all.
suggestionsLabelsuggestions-labelstringSuggestions (text tags-input.suggestions)The accessible name of the group of suggestions.
separatorsseparatorsstring,Characters that end a tag as they are typed or pasted (",;" for both); "" for none (Enter and leaving the field still add).
EventDescription
changeA tag was added or removed (read value).
inputSame moment as change.
SlotDescription
(default)<option> elements: the suggestions (the text is the tag; value, if different, is what the tag stores).
PartDescription
inputThe text field.
tagsThe tags container.
tagA tag.
tag-removeA tag's remove button.
suggestionsThe group of suggestions under the field.
suggestionA suggestion button.

Texts

What it writes itself, in English; setStrings() translates them (Getting started: Languages).

KeyEnglish
tags-input.removeRemove {label}
tags-input.suggestionsSuggestions