Marketing sectionsNewsletterBenefits
Searchastronomic.dev# NewsletterBenefits
To ask for signups beside a short list of what readers get.
Interactive: inline script.
## Usage
```astro
import NewsletterBenefits from "@astronomic/ui-pro/components/NewsletterBenefits.astro";
```
## Examples
### What readers get, beside the form
The header above, then the list of what readers get and the form side by side from a 48rem section (on the band, 48rem inside its padding), lined up at the top; below that they stack, the list first, so a reader sees why before the form. Each benefit has an icon, a title and a line. The form shows its label and posts to # here.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import NewsletterBenefits, { type NewsletterBenefit } from "@astronomic/ui-pro/components/NewsletterBenefits.astro";
import Lightbulb from "@lucide/astro/icons/lightbulb";
import PenLine from "@lucide/astro/icons/pen-line";
import Sparkles from "@lucide/astro/icons/sparkles";
const benefits: [NewsletterBenefit, ...NewsletterBenefit[]] = [
{ title: "One site we liked", text: "A short look at a site from someone else, and what makes it work.", icon: Sparkles },
{ title: "What we learned", text: "A note on something that went better, or worse, than we planned.", icon: Lightbulb },
{ title: "New work first", text: "The sites and themes we finished that month, before they go on the blog.", icon: PenLine },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<NewsletterBenefits heading="The studio, once a month" text="One short email. Read it in five minutes." benefits={benefits} form={{ action: "#", nameField: true }}>
<Badge slot="eyebrow">Newsletter</Badge>
<p slot="note" class="m-0">One email a month. Unsubscribe at any time.</p>
</NewsletterBenefits>
</div>
```
## Props
### NewsletterBenefits
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | The section heading, in the title role in display type. Without it there is no section and no header: a plain <div> holds only the body. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>: exactly two asterisks around text with no space inside, as in "Built for *the long run*". Any other asterisks show as typed. Off by default, so the heading shows as typed. How the <em> looks is the theme's. |
| `mark` | `string` | None | A short mark after the heading, such as "(12)" or "©2026", in small muted type. It sits beside the heading, outside it, so the heading's name stays plain. Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "12 projects": the mark is then hidden from screen readers and this is read in its place. Without it, the mark is read as written. |
| `text` | `string` | None | One or two sentences under the heading, in the lead role, muted. Shown only with a heading. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. Benefit titles, if any, sit one level under it. |
| `tone` | `"page" \| "band"` | `"page"` | The surface. page: on the page. band: the band (surface-band, the band when a preset sets --ui-band, else the page) with its focus ring, an edge and padding, wider once the section is 48rem across. The padding sits on a box inside the section, so a class you pass (padding too) goes to the section, around that box. The recipes' two columns then start when the space inside the padding is 48rem: on the band that is 48rem plus twice the wide padding. Give the form the same tone. |
| `class` | `string` | None | More classes for the root (the <section>, or the <div> without a heading), merged with cn(), so yours win on conflicts. The root is a named size container (inline-size containment): in a shrink-to-fit parent (inline-flex, a float, fit-content) it collapses, so give it a width there. |
| `itemHeadingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | `"h3"` | The title element when there is no heading. With a heading, titles sit one level under it. |
| `benefits` | `[NewsletterBenefit, ...NewsletterBenefit[]]` | None | Required. What readers get, in order, three or four: { title, text?, icon? } each (NewsletterBenefit). The icon is a component (Lucide's or your own SVG), drawn in the accent. Only these fields reach the markup. An empty list (from a CMS) shows only the form. |
| `form` | `SignupFormOptions` | None | Required. The form's settings: its action (required) and any SignupForm prop but tone and class (SignupFormOptions), spread onto the form, such as { action: "https://buttondown.com/api/emails/embed-subscribe/<user>", hiddenFields: [{ name: "embed", value: "1" }] }. A plain post is the safe default; see SignupForm for each provider's row. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. Shown only with a heading. |
| `note` | Under the form, small and muted: the privacy line. Passed to the SignupForm. |
Any other attribute goes on the <section>, or on the <div> without a heading.
## Accessibility
- With a heading, renders a <section> named by it, so it is a region landmark. The heading id is unique on the page.
- Without a heading, renders a plain <div>. Put your own heading above it.
- With tone="band", the section takes the band's background, text color and focus ring. A shell cannot pass the tone into its slot, so give the SignupForm tone="band" too (the recipes do it for you).
- The benefits are a list (<ul role="list">), so a screen reader says how many there are, and they come before the form.
- Each title sits one level under the section heading (h2 gives h3). With no heading, it is an h3 unless you set itemHeadingTag.
- The icons are decoration, hidden from screen readers.
- Each field has a visible label, or, with labelHidden, a label kept for screen readers only, when the heading beside the form already says what it is for. A placeholder is only a hint, never the label.
- The email field is type=email with autocomplete email and no spellcheck, and is required and marked so; the optional name field has autocomplete name.
- The note slot holds the privacy line (how often you write, how to unsubscribe), under the form, small and muted.
- With no script, or before it loads, the form posts to its action and the browser checks the email itself. Buttondown, Mailchimp and Formspree each show their own page after the post, so a signup works with no JavaScript.
- With enhance="fetch", a bad email gets its error text under the field, aria-invalid and the error id in aria-describedby, and focus moves to it. The FormStatus under the button says sending, then success or the error. Use it only with an endpoint that answers JSON (Formspree); Buttondown and Mailchimp must use a plain post.
NewsletterBenefits
ProTo ask for signups beside a short list of what readers get.
- File
- NewsletterBenefits.astro
- Group
- Marketing sections
- Kind
- Interactive: inline script
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
What readers get, beside the form
The header above, then the list of what readers get and the form side by side from a 48rem section (on the band, 48rem inside its padding), lined up at the top; below that they stack, the list first, so a reader sees why before the form. Each benefit has an icon, a title and a line. The form shows its label and posts to # here.
Minimal · Light