

Every state


default


hover


focus


filled


invalid


submitting


error


done


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string; | "newsletter-email" | Id of the email field; the label, consent line and messages hang off it. |
| action | string; | "/newsletter/subscribe" | Where the form posts when there is no `onSubscribe`. |
| name | string; | "email" | Name of the email field in the post. |
| label | string; | "Get the product notes" | Visible label. |
| placeholder | string; | "you@example.com" | Placeholder. |
| defaultValue | string; | "" | The address in the field at the start. |
| submitLabel | string; | "Subscribe" | Submit label. |
| submittingLabel | string; | "Subscribing…" | Submitting label. |
| what | string; | "What we shipped, what is next and one tip to get more out of it." | What is in it, one short sentence. |
| frequency | string; | "One email a month." | How often it comes. |
| unsubscribe | string; | "Unsubscribe any time." | Unsubscribe. |
| privacyLabel | string; | "Privacy" | Privacy label. |
| privacyHref | string; | "#privacy" | Privacy href. |
| invalidText | string; | "Enter an email address, like name@example.com." | Shown when the address is empty or not an address. |
| errorText | string; | Shown when `onSubscribe` fails; the address stays in the field. | |
| doneText | string; | "Almost done: open the email we just sent to confirm." | Shown in place of the consent line once `onSubscribe` succeeded. |
| onSubscribe | (email: string) => Promise<void>; | – | Subscribes on the page instead of posting; reject (or throw) when it failed. Left out: the form posts to `action`. |
| disabled | boolean; | – | Disables it. |
| className | string; | – | Extra classes on the outer element. |

