Veil UI
Components

Newsletter Section

An email capture band with an inline success state.

Installation

$ npx veil-ui@latest add newsletter-section

Usage

import { NewsletterSection } from "@/components/ui/newsletter-section";

<NewsletterSection onSubmit={subscribe} />;

Examples

Basic

Stay in the loop

Product updates and new components, once a month.

Custom

Get the changelog

Every release, summarized in one email.

API reference

The package exports newsletter-section along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.

Accessibility

  • Pages keep a single h1 in the hero and use h2/h3 for section hierarchy.
  • Call-to-action elements are real links or buttons with discernible labels.
  • Decorative icons are aria-hidden and meaningful images require alt text.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add newsletter-section --framework vue or switch the framework in components.json.

<template>
<div data-slot="newsletter-section" class="rounded-xl border bg-muted/20 px-6 py-10 text-center w-full max-w-3xl"><h2 class="text-2xl font-semibold tracking-tight">Stay in the loop</h2><p class="mx-auto mt-2 max-w-md text-sm text-muted-foreground">Product updates and new components, once a month.</p><form class="mx-auto mt-6 flex w-full max-w-md flex-col gap-2 sm:flex-row"><input type="email" data-slot="input" class="h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow,border-color] placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30 flex-1" required="" placeholder="you@example.com" aria-label="Email address" value=""/><button data-slot="button" data-variant="default" data-size="default" class="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&amp;_svg]:pointer-events-none [&amp;_svg]:shrink-0 [&amp;_svg:not([class*=&#x27;size-&#x27;])]:size-4 bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2" type="submit">Subscribe</button></form></div>
</template>

On this page