GitHub

Email Capture

Block
Lightweight inline email signup for newsletters and subscriptions

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { EmailCapture } from "@corew500/ui/blocks/email-capture"

<EmailCapture>Content</EmailCapture>

Stacked

Loading...

CMS Integration

CMSPayload CMS Integration
This component supports CMS-driven content via @corew500/cms-payload.
Loading...

API Reference

Props

PropTypeDefaultDescription
onSubmit(email: string) => void | Promise<void>Form submit handler. Receives the email address. Can be async - loading state is managed internally if not controlled.
layoutenuminlineLayout variant. - `inline`: Email input and button side-by-side - `stacked`: Email input above button
sizeenumdefaultSize variant.
buttonLabelstringSubscribeSubmit button label.
loadingenumControlled loading state. If not provided, component manages loading state internally.
loadingLabelstringSubscribing...Loading button label.
successenumfalseSuccess state. When true, shows success message instead of form.
successMessagestringThanks for subscribing!Success message text.
placeholderstringEnter your emailInput placeholder text.
errorstringError message to display.
buttonVariantenumdefaultButton variant.
privacyTextstringPrivacy text (e.g., "We respect your privacy").
privacyHrefstringPrivacy link href.
privacyLabelstringPrivacy PolicyPrivacy link label.
glowenumfalseEnable glow effect on input and button.

Accessibility

Keyboard Navigation

  • - Input has proper type="email" for keyboard optimization

Screen Readers

  • Input has associated label via aria-label
  • Error messages are associated via aria-describedby

Additional

  • Submit button has accessible label

Localization

Translatable Content

  • - Component accepts pre-resolved translated strings
  • All text customizable: buttonLabel, loadingLabel, successMessage, placeholder, error, privacyText, privacyLabel

Related