TagInput
Token entry for invite lists and label sets. Pasting a comma separated list adds every entry at once.
Enter or comma to add. Paste a comma separated list to add several.
No validation, no cap.
invites = ["ada@example.com"]
import { TagInput, Field } from '@objectifthunes/whiteboard'
<Field label="Invite teammates" hint="Enter or comma to add.">
<TagInput
value={emails}
onChange={setEmails}
placeholder="name@company.com"
max={5}
validate={v => isEmail(v) ? null : `"${v}" is not an email address.`}
/>
</Field>The SaaS uses are invite lists, label sets and allowed domains. Duplicates and blanks are rejected by default; anything else — an email shape, a reserved word, a length cap — goes in validate, which returns the message to show rather than throwing.
Pasting a comma or newline separated list adds every entry at once, because that is how people move a list of emails out of a spreadsheet. A single paste with no separator types normally, so you can still paste one address and edit it.
Backspace on an empty input removes the last tag. Blurring commits whatever is half-typed, so an address you typed but did not press Enter on is not silently lost when you click Submit.