Recipient Input
Forms · RecipientInput
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.
One address is not valid.
Props
RecipientInput
| Prop | Type | Notes |
|---|---|---|
label | string | Required |
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) => boolean | Your own address check (default: a plain e-mail pattern). |
placeholder? | string | |
hint? | string | |
error? | string | |
disabled? | boolean | |
autoFocus? | boolean | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |