GitHub

CTA Form

Block
Form-based call-to-action block with optional features list

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { CTAForm } from "@corew500/ui/blocks/cta-form"

<CTAForm>Content</CTAForm>

API Reference

Props

PropTypeDefaultDescription
heading*stringMain heading
subheadingstringSubheading/description
featuresCTAFormFeature[][]List of features to display
onFormSubmit(data: CTAFormData) => voidForm submit handler
showPasswordenumtrueShow password field
showNameenumfalseShow name field
loadingenumfalseLoading state
submitLabelstringGet StartedSubmit button label
loadingLabelstringCreating account...Loading button label
loginTextstringAlready have an account?Login link text
loginHrefstring#Login link href
loginLabelstringSign inLogin link label
glowenumfalseEnable glow effects
placeholders{ email?: string; password?: string; name?: string; }{}Field placeholders
labels{ email?: string; password?: string; name?: string; }{}Field labels (i18n)
errorsRecord<string, string>{}Validation errors
featureIconenumCustom icon for all features (overrides individual icons)
passwordDescriptionstringMust be at least 8 characters.Password description text
customFieldsCTAFormField[][]Additional custom fields (text, email, or select) rendered after the built-in fields
variantenumdefault
sizeenumdefault

Accessibility

Keyboard Navigation

  • All interactive elements are keyboard navigable

Screen Readers

  • Error messages linked via aria-describedby and aria-invalid
  • Features list uses semantic <ul>/<li> elements with aria-hidden icons

Additional

  • - All form fields have proper label associations via htmlFor/id
  • Submit button shows disabled state during loading

Localization

Translatable Content

  • - Component accepts pre-resolved translated strings
  • All user-facing text is customizable via props:
  • `heading`, `subheading` - Header text
  • `labels` - Field labels (email, password, name)
  • `submitLabel`, `loadingLabel` - Button text
  • `loginText`, `loginLabel` - Login link text
  • `passwordDescription` - Password field helper text
  • `features[].text` - Feature list items
  • No internal text hardcoding - all strings flow through props with English defaults

Additional

  • `placeholders` - Input placeholders
  • Validation errors via `errors` prop

Related