TagInput

A list of short values typed into one field. Enter or a comma adds what is typed (a pasted "a, b, c" adds three), Backspace in the empty field removes the last tag, and every tag has a remove button named "Remove <tag>". Duplicates and anything over max are refused with a reason. Each add and remove is announced through useAnnouncer. With suggestions, the field is an APG combobox with a listbox: the arrows move the active option, Enter adds it, Escape closes the list and then clears the text.

Install: pnpm add-component Fields/TagInput

Basic usage

Type and press Enter, or type a comma. Backspace in the empty field removes the last tag; the arrow toward the tags moves onto their remove buttons.

Suggestions

An APG combobox: Down opens the list, Up and Down move, Enter adds the active option, Escape closes it.

Limit

A fourth label is refused, and the reason is shown and announced.

Error

In AppForm, type: "tags" fills the error from the schema; items become the suggestions and max the limit.

API