TagInput
Removable tags in a field: Enter, comma and paste split them; Backspace removes the last.
<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.
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.
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.
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 (and to a screen reader); errors are never drawn under the field, so toast it too when someone submits.
valuestring[]The tags, when you control them.