Contact Us

Form Primitives

Visual showcase of form primitives. Each section demonstrates variants, states, and accessibility behavior.

FormField

Universal form field wrapper. Composes label, input/textarea, help text, and error display into an accessible unit.

Text Input (required)

Email Input

We'll never share your email with anyone else.

Phone Input

Optional. Include country code for international numbers.

Textarea

Show code
{/* Text input */}
<FormField
  name="demo-name"
  label="Full Name"
  required={true}
  placeholder="Jane Smith"
  autocomplete="name"
/>

{/* Email input with help text */}
<FormField
  name="demo-email"
  label="Email Address"
  type="email"
  required={true}
  placeholder="[email protected]"
  autocomplete="email"
  helpText="We'll never share your email with anyone else."
/>

{/* Phone input */}
<FormField
  name="demo-phone"
  label="Phone Number"
  type="tel"
  placeholder="(555) 123-4567"
  autocomplete="tel"
  helpText="Optional. Include country code for international numbers."
/>

{/* Textarea */}
<FormField
  name="demo-message"
  label="Message"
  type="textarea"
  required={true}
  placeholder="How can we help?"
  rows={5}
/>

ListBox

Custom select with ARIA listbox pattern, keyboard navigation, disabled options, and native fallback. Relocated from primitives (D-C8-11).

Default

Choose a service…
  • Design services
  • Web development
  • SEO optimization
  • Legacy support
  • Consulting

With Initial Value

Choose a service…
  • Design services
  • Web development
  • SEO optimization
  • Legacy support
  • Consulting
Show code
const selectOptions = [
  { value: "design", label: "Design services" },
  { value: "web", label: "Web development" },
  { value: "seo", label: "SEO optimization" },
  { value: "legacy", label: "Legacy support", disabled: true },
  { value: "consulting", label: "Consulting" },
];

{/* Default */}
<ListBox
  options={selectOptions}
  name="demo-service"
  placeholder="Choose a service…"
/>

{/* With initial value */}
<ListBox
  options={selectOptions}
  name="demo-service-preset"
  placeholder="Choose a service…"
  initialValue="web"
/>

FormError

Error display for individual fields or the form as a whole. Hidden by default; vanilla JS shows and populates when validation fails.

Field-Level Error (static demo)

Please enter a valid email address.

Form-Level Error (static demo)

Show code
{/* Field-level error — hidden via :empty, visible when content is present */}
<FormError fieldName="demo-field">
  Please enter a valid email address.
</FormError>

{/* Form-level error */}
<FormError>
  There were errors with your submission. Please review the fields below.
</FormError>

FormStatus

Post-submission status display. Shows loading, success, or error states. Vanilla JS drives visibility transitions.

Success State (static demo)

Message sent!

Thank you for reaching out. We'll get back to you within 24 hours.

Error State (static demo)

Message sent

We'll get back to you soon.

Show code
{/* Success state — parent handler sets data-state="open" on success slot */}
<FormStatus
  successTitle="Message sent!"
  successMessage="Thank you for reaching out. We'll get back to you within 24 hours."
  resetLabel="Send another message"
/>

{/* Error state — parent handler sets data-state="open" on error slot */}
<FormStatus errorMessage="Something went wrong. Please try again." />

CaptchaField

Cloudflare Turnstile CAPTCHA widget wrapper. In development (no site key), shows a placeholder with bypass token.

Dev-Mode Placeholder

CAPTCHA placeholder — no site key configured. Bypass token provided for development.

Show code
<form>
  <CaptchaField />
</form>

Section Components

Full-featured form sections composed from the primitives above. These are the components used on actual pages.

Message sent!

Thank you for reaching out. We'll get back to you within 24 hours.

Optional. Include country code for international numbers.

Select a topic…
  • General Inquiry
  • Project Quote
  • Support
  • Other

CAPTCHA placeholder — no site key configured. Bypass token provided for development.

Show code
<LayoutSection contentWidth="wide">
  <ContactForm
    heading="Contact Form Demo"
    description="Two-column layout with business contact info and JS-enhanced form."
  />
</LayoutSection>
Show code
<LayoutSection contentWidth="content" verticalPadding="2xl">
  <NewsletterSignup
    heading="Newsletter Signup Demo"
    description="Standalone section with centered layout and newsletter form."
  />
</LayoutSection>

NewsletterForm (Compact)

Embeddable form fragment with reduced spacing. Designed for footer, sidebar, or CTA contexts.

Show code
<NewsletterForm compact={true} />

Search

Search across pages and articles. Use arrow keys to navigate results.

Search across pages and articles.

Loading search...

Search is unavailable. Please try again later.

    No results for ""

    Try different keywords or fewer words.