09 · contact-formsForms & Inputs5 Variations
Contact Forms
Controlled inquiry forms with client-side blur and submit validation, accessible label/error wiring, focus routing to invalid controls, loading states, and documented local demo submission behavior.
contactformsvalidationmulti-stepaccessible
Split Layout
contact-forms/split-layout
Loading variation contact-forms/split-layout...
Component Information
Asymmetric 2-column studio intake pairing SLA details on the left with a controlled name, email, topic selector, and brief form on the right.
- Variation ID
- contact-forms/split-layout
- Motion Engine
- css
- Source File
- src/labs/components/components/contact-forms/variations/split-layout.tsx
Reduced Motion & Accessibility
Loading spinner uses subtle rotate utility; border/ring focus shifts are static color transitions.
- Validation errors appear after blur or submit and clear on input.
- Failed submit moves keyboard focus to the first invalid control and sets aria-invalid="true".
Dependencies
- lucide-react^0.553.0Required
AlertCircle, CheckCircle2, Loader2, and Send status/submit icons
Usage Documentation
import { SplitContactForm } from '@/src/labs/components/components/contact-forms';
export function StudioContactSection() {
return (
<SplitContactForm
onSubmit={async (values) => {
await fetch('/api/contact', { method: 'POST', body: JSON.stringify(values) });
}}
/>
);
}Props API (7)
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | 'Start a technical conversation' | Section heading wired via aria-labelledby. |
| description | string | — | Introductory copy. |
| labels | ContactFormLabels | — | Configurable field labels, placeholders, and submit button text. |
| topics | readonly string[] | — | Options rendered inside the inquiry topic selector. |
| onSubmit | (values: ContactFormValues) => Promise<void> | void | — | Optional backend integration handler; runs local demo mode when omitted. |
| demoOutcome | 'success' | 'error' | 'success' | Simulated result in demo mode. |
| allowOutcomeToggle | boolean | true | Shows inline checkbox to preview error state. |