Skip to content
Twentyfirst UIHalo

Recipient Input

Forms · RecipientInput

View as Markdown

Address chips for To, Cc and Bcc. Type and press Enter, comma or Tab; pick from suggestions (or suggest, asked while typing) with the arrow keys; paste several addresses at once (a@x.com, Bo Lee <bo@y.com>). Invalid addresses stay as red chips with a message, Backspace in the empty field removes the last chip. The value is a list of { address, name? }; parseRecipients and isEmailAddress are exported too.

Lena Hartnoah.berg@
One address is not valid.

Props

RecipientInput

PropTypeNotes
labelstringRequired
hideLabel?boolean
id?string
value?MailRecipient[]The addresses (controlled) / initially / on change.
defaultValue?MailRecipient[]
onChange?(value: MailRecipient[]) => void
suggestions?MailRecipient[]Known addresses, filtered while typing.
suggest?(typed: string) => MailRecipient[] | Promise<MailRecipient[]>Or ask your server while typing (debounced).
validate?(address: string) => booleanYour own address check (default: a plain e-mail pattern).
placeholder?string
hint?string
error?string
disabled?boolean
autoFocus?boolean
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.