Passer au contenu principal

NewsletterSlotTrigger

Implemented

Newsletter slot trigger (ADR-069 / plan T6, decision D17): a tiny client component that renders a real <button type="button"> and dispatches the DOM CustomEvent 'ep:newsletter-open' on window (detail: { source }). It bridges the server/client boundary for server-rendered slots such as FooterStub, where a function prop cannot cross — the consumer listens for the event and opens its modal. Ships no hardcoded copy: the CTA label and the accessible name are props.

Categorymolecules
Sourcecomponents/molecules/newsletter/NewsletterSlotTrigger.tsx
AI HintUse for grouped UI patterns. Combine atoms into functional units.

Catalog fallback

Live MDX preview not available for NewsletterSlotTrigger. Showing component catalog metadata instead.

Props

Preview

NewsletterSlotTrigger

Prop
Type
Required
Default
Description
ctaLabel
string
Required
—

Visible button label.

ariaLabel
string
Optional
—

Accessible name for the button — compose it from consumer copy when the surrounding slot already shows a heading.

source
string
Optional
"footer"

Source tag carried by the dispatched event.

className
string
Optional
—

Additional CSS classes on the button.

Quick use:<NewsletterSlotTrigger />

Accessibility

ARIA rolebutton

behavior

2 rules

ADR-069 / D17

Renders a <button type="button"> that dispatches the 'ep:newsletter-open' CustomEvent on window — no callback props cross the server/client boundary

ADR-069 / D16

Ships no hardcoded user-visible copy — the CTA label is a prop

ARIA

1 rule

WCAG 4.1.2 / 2.5.5 / 2.4.7

The button exposes an accessible name (visible label or aria-label) and meets the 44px tap minimum (--ep-tap-min) with a visible focus ring

Usage

Import

tsxSnippet
import { NewsletterSlotTrigger } from "@epasslive/design-system"

Example 1

tsxSnippet
<NewsletterSlotTrigger ctaLabel="Subscribe" ariaLabel="Newsletter" />

Anti-patterns

— Do not hardcode data in molecules

— Do not pass callback props across the server/client boundary — dispatch a DOM event instead

Design System v4.1.0 | ePassLive