

Every state


default


hover


focus


chosen


no-topic


invalid


submitting


done


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string; | "newsletter-topics" | Prefix for the ids inside. |
| action | string; | "/newsletter/subscribe" | Where the form posts when there is no `onSubscribe`. |
| legend | string; | "What would you like to hear about?" | Legend. |
| legendHint | string | null; | "Choose one or more. You can change this in any email." | A line under the legend. Null: none. |
| topics | NewsletterFieldTopic[]; | [ { id: "releases", title: "Release notes", detail: "What changed, once a month", }, { id: "guides", title: "Guides",… | Topics. |
| defaultTopics | string[]; | [] | Ids of the topics chosen at the start. |
| topicsErrorText | string; | "Choose at least one topic." | Shown when no topic is chosen. |
| emailLabel | string; | "Email address" | Email label. |
| placeholder | string; | "you@example.com" | Placeholder. |
| defaultValue | string; | "" | The address in the field at the start. |
| invalidText | string; | "Enter an email address, like name@example.com." | Shown when the address is empty or not an address. |
| submitLabel | string; | "Subscribe" | Submit label. |
| submittingLabel | string; | "Subscribing…" | Submitting label. |
| frequency | string; | "Only the topics you chose. Unsubscribe any time." | How often it comes, and that you can stop. |
| privacyLabel | string; | "Privacy" | Privacy label. |
| privacyHref | string; | "#privacy" | Privacy href. |
| errorText | string; | Shown when `onSubscribe` fails; the choices stay. | |
| doneText | string; | "Almost done: open the email we just sent to confirm." | Shown in place of the consent line once `onSubscribe` succeeded. |
| onSubscribe | ( subscription: NewsletterFieldTopicsSubscription, ) => 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. |
More newsletter fields
All 3newsletter-field-03 is in UI ProGet UI Pro, €199

