# Footer with newsletter signup

> Footer with a prominent newsletter panel, a native email form, and a compact resource and copyright row.

- Kind: block · Category: Footer · Interactivity: native
- Install: `npx shadcn@latest add @haze/footer-newsletter`
- File: `src/components/haze/blocks/footer-newsletter.astro`
- npm dependencies: @lucide/astro
- Registry dependencies: @haze/button, @haze/input, @haze/logo-mark, @haze/utils
- Docs page: https://hazeui.com/blocks/footer-newsletter

## Use when
- A publication or product collects subscriptions at the end of most pages
- The signup needs space for a clear description and privacy note

## Avoid when
- There is no subscription endpoint. Use footer-compact.
- The newsletter should sit independently of the site footer. Use newsletter-inline.

## Alternatives
- [footer-compact](https://hazeui.com/blocks/footer-compact.md)
- [footer-accordion](https://hazeui.com/blocks/footer-accordion.md)
- [newsletter-inline](https://hazeui.com/blocks/newsletter-inline.md)

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| id | `string` | "haze-footer-newsletter" | no | Unique prefix used to associate the control with its label and hint. |
| brand | `string` | "Fieldwork" | no | Wordmark text. |
| homeHref | `string` | "/" | no | Destination of the wordmark link. |
| title | `string` | "The Fieldwork dispatch" | no | Heading introducing the newsletter. |
| headingLevel | `2 \| 3 \| 4` | 2 | no | Heading level appropriate to the containing page. |
| description | `string` | Demo dispatch description | no | Describe what readers will get and how often. |
| formAction | `string` |  | no | Required to receive subscriptions. The form sends the email field in a POST. The preview uses a placeholder endpoint and labels it. |
| emailLabel | `string` | "Email address" | no | Visible label for the email field. |
| emailPlaceholder | `string` | "you@company.com" | no | Example address shown in the empty field. |
| submitLabel | `string` | "Subscribe" | no | Text on the form submit button. |
| privacyNote | `string` | "Unsubscribe at any time." | no | Hint associated with the email field when an endpoint is configured. Empty text hides it. |
| links | `Link[]` | Documentation, Browse the library | no | Resource or policy links below the form. |
| navLabel | `string` | "Footer links" | no | Accessible name for the footer navigation. |
| copyright | `string` | "© 2026 Fieldwork" | no | Copyright or attribution text. |
| class | `string` |  | no | Additional classes on the footer. |

## Accessibility
- The email input has a persistent, visible label and uses native email validation.
- The form description is associated with the field when present. The server handles errors and confirmation after submission.
- Key Enter: Submit the email address from the field or button.

## Agent prompts

### Install and use

Install the Haze UI block "Footer with newsletter signup" with `npx shadcn@latest add @haze/footer-newsletter`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import FooterNewsletter from "@/components/haze/blocks/footer-newsletter.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/footer-newsletter.md

### Customize with real content

Adapt the Haze footer-newsletter block for our product. Replace the demo values of these props with our real content: id, brand, homeHref, title, headingLevel, description, formAction, emailLabel, emailPlaceholder, submitLabel, privacyNote, links, navLabel, copyright, class. Keep the layout, the heading level rules and these accessibility details: The email input has a persistent, visible label and uses native email validation. The form description is associated with the field when present. The server handles errors and confirmation after submission. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using footer-newsletter, check it fits: use it when a publication or product collects subscriptions at the end of most pages; the signup needs space for a clear description and privacy note. Avoid it when there is no subscription endpoint. use footer-compact.; the newsletter should sit independently of the site footer. use newsletter-inline.. Alternatives: @haze/footer-compact, @haze/footer-accordion, @haze/newsletter-inline.

## Example requests that should lead here
- Create a site footer that posts newsletter signups to /api/subscribe
- Add a monthly dispatch signup with visible email label and privacy copy

## Source

```astro
---
import { Mail } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";
import Button from "../ui/button.astro";
import Input from "../ui/input.astro";
import LogoMark from "../ui/logo-mark.astro";

interface Link { label: string; href: string }
interface Props {
  id?: string;
  brand?: string;
  homeHref?: string;
  title?: string;
  headingLevel?: 2 | 3 | 4;
  description?: string;
  formAction?: string;
  emailLabel?: string;
  emailPlaceholder?: string;
  submitLabel?: string;
  privacyNote?: string;
  links?: Link[];
  navLabel?: string;
  copyright?: string;
  class?: string;
}

const {
  id = "haze-footer-newsletter",
  brand = "Fieldwork",
  homeHref = "/",
  title = "The Fieldwork dispatch",
  headingLevel = 2,
  description = "New blocks, release notes, and practical ideas for your next build. One email a month.",
  formAction,
  emailLabel = "Email address",
  emailPlaceholder = "you@company.com",
  submitLabel = "Subscribe",
  privacyNote = "Unsubscribe at any time.",
  links = [{ label: "Documentation", href: "/docs/" }, { label: "Browse the library", href: "/browse/" }],
  navLabel = "Footer links",
  copyright = "© 2026 Fieldwork",
  class: className,
} = Astro.props;
const Heading = `h${headingLevel}` as const;
---

<footer class={cn("border-t border-border bg-muted/40 px-4 pt-8 pb-5 sm:px-6 sm:pt-12", className)}>
  <div class="mx-auto max-w-6xl">
    <div class="grid items-center gap-6 rounded-2xl border border-border bg-card p-4 text-card-foreground sm:p-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,25rem)] lg:p-8">
      <div class="min-w-0 wrap-anywhere">
        <span class="mb-3 grid size-9 place-items-center rounded-lg bg-muted text-muted-foreground"><Mail aria-hidden="true" class="size-4" /></span>
        <Heading class="text-xl/7 font-semibold tracking-tight sm:text-2xl/8">{title}</Heading>
        <p class="mt-1.5 max-w-md text-sm/6 text-muted-foreground">{description}</p>
      </div>
      <form action={formAction ?? "/subscribe"} method="post" class="grid min-w-0 gap-2">
        <label for={`${id}-email`} class="text-sm/5 font-medium">{emailLabel}</label>
        <div class="flex min-w-0 flex-col gap-2 sm:flex-row">
          <Input id={`${id}-email`} name="email" type="email" autocomplete="email" placeholder={emailPlaceholder} aria-describedby={privacyNote || !formAction ? `${id}-hint` : undefined} required />
          <Button type="submit" class="h-auto min-h-9 py-1.5 whitespace-normal wrap-anywhere">{submitLabel}</Button>
        </div>
        {(privacyNote || !formAction) && (
          <p id={`${id}-hint`} class="text-[0.8125rem]/5 text-muted-foreground">
            {formAction ? privacyNote : "Preview form. Supply a subscription endpoint to collect signups."}
          </p>
        )}
      </form>
    </div>
    <div class="mt-5 flex flex-wrap items-center justify-between gap-x-5 gap-y-2">
      <a href={homeHref} aria-label={`${brand} home`} class="inline-flex min-h-8 items-center rounded-md focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring">
        <LogoMark name={brand} shape="square" class="text-foreground" />
      </a>
      {links.length > 0 && (
        <nav aria-label={navLabel}>
          <ul role="list" class="flex flex-wrap gap-x-4">
            {links.map((link) => <li><a href={link.href} class="inline-flex min-h-8 items-center rounded-sm text-[0.8125rem]/5 wrap-anywhere text-muted-foreground transition-colors duration-150 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring">{link.label}</a></li>)}
          </ul>
        </nav>
      )}
      <p class="text-[0.8125rem]/5 wrap-anywhere text-muted-foreground">{copyright}</p>
    </div>
  </div>
</footer>
```
