TagInput
Removable tags in a field: Enter, comma and paste split them; Backspace selects the last, a second press removes it.
<div className="w-400">
<TagInput label="Invite members" placeholder="name@example.com" defaultValue={["lin@northwind.example", "tomas@northwind.example"]} validate={email} />
</div>import { TagInput } from "@logicplanes/kaeso-ui";Props
aria-labelstringThe accessible name, for when there is no visible label.
defaultValuestring[]The tags on first render.
descriptionReactNodeOne sentence of help under the label.
disabledbooleanTurns it off: it can't be used, and it looks dimmed.
errorReactNodeThe error message, shown under the control in the danger color; it marks the control invalid and is read out with its description.
idstringThe id of the control, so a label elsewhere can point to it.
labelReactNodeThe visible label.
layout"horizontal" | "vertical"The label above the control (
vertical) or beside it (horizontal).namestringThe field name the value is sent under in a form.
onInputValueChange((draft: string) => void)Called with the text typed but not added as a tag yet, so a form can count it before it is added.
onValueChange((value: string[]) => void)Called with the tags whenever one is added or removed.
optionalbooleanAdds “Optional” to the label, for forms where most fields are required.
placeholderstringText shown while there is no value.
requiredbooleanMarks it as required in a form.
separatorsstring[]Characters that end a tag, besides Enter; pasted text also splits at line breaks and tabs.
validate((tag: string) => string | true)Return true for a valid tag, or a message saying what is wrong. Invalid tags stay, marked with a danger ring, and show the message as their tooltip; the first one also shows under the field.
valuestring[]The tags, when you control them.