GitHub

CTAForm

A form-based call-to-action block with email/password/name fields and a features checklist.

Loading...

Installation

pnpm add @corew500/ui

Usage

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

<CTAForm
  heading="Start your free trial"
  subheading="Join 10,000+ teams already using our platform."
  features={[
    { text: '14-day free trial, no credit card required' },
    { text: 'Cancel any time' },
    { text: 'Access to all features' },
  ]}
  showName
  showPassword
  submitLabel="Create Account"
  onFormSubmit={(data) => handleSignup(data)}
/>

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