Email Capture
BlockBasic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { EmailCapture } from "@corew500/ui/blocks/email-capture"
<EmailCapture>Content</EmailCapture>Stacked
Loading...
CMS Integration
Loading...
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | (email: string) => void | Promise<void> | — | Form submit handler. Receives the email address. Can be async - loading state is managed internally if not controlled. |
| layout | enum | inline | Layout variant. - `inline`: Email input and button side-by-side - `stacked`: Email input above button |
| size | enum | default | Size variant. |
| buttonLabel | string | Subscribe | Submit button label. |
| loading | enum | — | Controlled loading state. If not provided, component manages loading state internally. |
| loadingLabel | string | Subscribing... | Loading button label. |
| success | enum | false | Success state. When true, shows success message instead of form. |
| successMessage | string | Thanks for subscribing! | Success message text. |
| placeholder | string | Enter your email | Input placeholder text. |
| error | string | — | Error message to display. |
| buttonVariant | enum | default | Button variant. |
| privacyText | string | — | Privacy text (e.g., "We respect your privacy"). |
| privacyHref | string | — | Privacy link href. |
| privacyLabel | string | Privacy Policy | Privacy link label. |
| glow | enum | false | Enable 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