Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

Contact Form (Two-column)

sherylc44b37ad40ef
diff --git a/packages/cli/templates/form-two-column/form-two-column.css b/packages/cli/templates/form-two-column/form-two-column.css
new file mode 100644
index 0000000000..ae3e33843f
--- /dev/null
+++ b/packages/cli/templates/form-two-column/form-two-column.css
@@ -0,0 +1,73 @@
+.ftc-page {
+ background-color: var(--color-background-surface);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 100svh;
+ padding: 48px;
+}
+.ftc-inner {
+ max-width: 1100px;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ gap: 56px;
+}
+.ftc-top-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 80px;
+ align-items: center;
+}
+.ftc-headline {
+ font-size: 48px;
+ font-weight: 700;
+ line-height: 1.05;
+ letter-spacing: -0.03em;
+ margin: 0;
+}
+.ftc-image {
+ width: 85%;
+ aspect-ratio: 4 / 3;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 12px;
+ overflow: hidden;
+}
+.ftc-inline-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 12px;
+}
+.ftc-footer-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ gap: 32px;
+ padding-top: 32px;
+ text-align: center;
+}
+.ftc-footer-label {
+ text-transform: uppercase;
+ letter-spacing: 0.08em;
+}
+@media (max-width: 767px) {
+ .ftc-page {
+ padding: 20px;
+ align-items: flex-start;
+ }
+ .ftc-top-grid {
+ grid-template-columns: 1fr;
+ gap: 32px;
+ }
+ .ftc-image {
+ width: 100%;
+ }
+ .ftc-footer-grid {
+ grid-template-columns: 1fr;
+ text-align: left;
+ }
+ .ftc-inline-grid {
+ grid-template-columns: 1fr;
+ }
+}
diff --git a/packages/cli/templates/form-two-column/illustration.png b/packages/cli/templates/form-two-column/illustration.png
new file mode 100644
index 0000000000..9f26238f3b
Binary files /dev/null and b/packages/cli/templates/form-two-column/illustration.png differ
diff --git a/packages/cli/templates/form-two-column/page.tsx b/packages/cli/templates/form-two-column/page.tsx
new file mode 100644
index 0000000000..b6d50dd3b2
--- /dev/null
+++ b/packages/cli/templates/form-two-column/page.tsx
@@ -0,0 +1,244 @@
+'use client';
+
+import {useState} from 'react';
+import * as stylex from '@stylexjs/stylex';
+import {XDSVStack} from '@xds/core/Layout';
+import {XDSButton} from '@xds/core/Button';
+import {XDSText} from '@xds/core/Text';
+import {XDSTextInput} from '@xds/core/TextInput';
+import {XDSToken} from '@xds/core/Token';
+import {XDSTextArea} from '@xds/core/TextArea';
+import {XDSLink} from '@xds/core/Link';
+import {XDSDivider} from '@xds/core/Divider';
+import {XDSCard} from '@xds/core/Card';
+import {XDSSelector} from '@xds/core/Selector';
+import Image from 'next/image';
+import illustrationSrc from './illustration.png';
+import {colorVars, spacingVars, radiusVars} from '@xds/core/theme/tokens.stylex';
+import './form-two-column.css';
+
+// ─────────────────────────────────────────────────────────────
+// Constants
+// ─────────────────────────────────────────────────────────────
+
+const INQUIRY_REASONS = [
+ 'New business',
+ 'General inquiry',
+ 'Press & media',
+ 'Partnerships',
+ 'Product feedback',
+ 'Technical support',
+ 'Other',
+];
+
+const BUDGET_OPTIONS = [
+ 'Under $10k',
+ '$10k – $50k',
+ '$50k – $100k',
+ '$100k – $500k',
+ '$500k+',
+ 'Not sure yet',
+];
+
+const CONTACT_COLUMNS = [
+ {label: 'General inquiries', email: '[email protected]'},
+ {label: 'New business', email: '[email protected]'},
+ {label: 'Press & partnerships', email: '[email protected]'},
+];
+
+// ─────────────────────────────────────────────────────────────
+// Styles — tokens for colors, radius, spacing only
+// Grid layout lives in form-two-column.css
+// ─────────────────────────────────────────────────────────────
+
+const styles = stylex.create({
+ imagePlaceholder: {
+ backgroundColor: colorVars['--color-background-surface'],
+ borderRadius: radiusVars['--radius-container'],
+ overflow: 'hidden',
+ alignSelf: 'flex-start',
+ },
+ tokenWrap: {
+ display: 'flex',
+ flexWrap: 'wrap',
+ gap: spacingVars['--spacing-2'],
+ },
+ fullWidth: {
+ width: '100%',
+ },
+});
+
+// ─────────────────────────────────────────────────────────────
+// Page
+// ─────────────────────────────────────────────────────────────
+
+/**
+ * Form (Two-column) — marketing contact form template.
+ *
+ * Layout:
+ * Top: two-column — left has headline + description + illustration,
+ * right has the contact form on a card.
+ * Bottom: three-column contact info strip.
+ * Mobile (<768px): single column stack.
+ */
+export default function FormTwoColumnPage() {
+ const [fullName, setFullName] = useState('');
+ const [email, setEmail] = useState('');
+ const [company, setCompany] = useState('');
+ const [jobTitle, setJobTitle] = useState('');
+ const [phone, setPhone] = useState('');
+ const [inquiryReason, setInquiryReason] = useState('');
+ const [budget, setBudget] = useState('');
+ const [details, setDetails] = useState('');
+ const [submitted, setSubmitted] = useState(false);
+
+ const errors = submitted
+ ? {
+ fullName: !fullName.trim() ? 'Required' : undefined,
+ email: !email.trim() ? 'Required' : undefined,
+ details: !details.trim() ? 'Required' : undefined,
+ }
+ : {};
+
+ const handleSubmit = () => setSubmitted(true);
+
+ return (
+ <div className="ftc-page">
+ <div className="ftc-inner">
+
+ {/* ── Top: two-column ── */}
+ <div className="ftc-top-grid">
+
+ {/* Left: headline + description + illustration */}
+ <XDSVStack gap={6}>
+ <XDSVStack gap={3}>
+ <div className="ftc-headline">
+ Let&apos;s work together
+ </div>
+ <XDSText type="body" color="secondary">
+ Tell us what you&apos;re working on and we&apos;ll help you
+ figure out the best path forward.
+ </XDSText>
+ </XDSVStack>
+ <div className="ftc-image" {...stylex.props(styles.imagePlaceholder)}>
+ <Image
+ src={illustrationSrc}
+ alt="Illustration"
+ style={{width: '100%', height: '100%', objectFit: 'contain'}}
+ />
+ </div>
+ </XDSVStack>
+
+ {/* Right: form on a card */}
+ <XDSCard padding={8}>
+ <XDSVStack gap={4}>
+ <XDSText type="label">Your details</XDSText>
+ <XDSTextInput
+ label="Full name"
+ isLabelHidden
+ placeholder="Full name*"
+ value={fullName}
+ onChange={setFullName}
+ status={errors.fullName ? {type: 'error', message: errors.fullName} : undefined}
+ />
+ <div className="ftc-inline-grid">
+ <XDSTextInput
+ label="Email"
+ isLabelHidden
+ placeholder="Email*"
+ value={email}
+ onChange={setEmail}
+ status={errors.email ? {type: 'error', message: errors.email} : undefined}
+ />
+ <XDSTextInput
+ label="Company name"
+ isLabelHidden
+ placeholder="Company name"
+ value={company}
+ onChange={setCompany}
+ />
+ </div>
+ <div className="ftc-inline-grid">
+ <XDSTextInput
+ label="Job title"
+ isLabelHidden
+ placeholder="Job title"
+ value={jobTitle}
+ onChange={setJobTitle}
+ />
+ <XDSTextInput
+ label="Phone number"
+ isLabelHidden
+ placeholder="Phone number"
+ value={phone}
+ onChange={setPhone}
+ />
+ </div>
+
+ <XDSVStack gap={2}>
+ <XDSText type="label">What are you reaching out about?</XDSText>
+ <div {...stylex.props(styles.tokenWrap)}>
+ {INQUIRY_REASONS.map(reason => (
+ <XDSToken
+ key={reason}
+ label={reason}
+ color={inquiryReason === reason ? 'blue' : 'default'}
+ onClick={() =>
+ setInquiryReason(prev =>
+ prev === reason ? '' : reason,
+ )
+ }
+ />
+ ))}
+ </div>
+ </XDSVStack>
+ <XDSSelector
+ label="Budget range"
+ options={BUDGET_OPTIONS}
+ value={budget}
+ onChange={setBudget}
+ placeholder="Select a budget range..."
+ />
+ <XDSTextArea
+ label="Project details"
+ isLabelHidden
+ placeholder="Project details*"
+ value={details}
+ onChange={setDetails}
+ status={errors.details ? {type: 'error', message: errors.details} : undefined}
+ />
+ <XDSButton
+ label="Let's connect"
+ variant="primary"
+ xstyle={styles.fullWidth}
+ onClick={handleSubmit}
+ />
+ </XDSVStack>
+ </XDSCard>
+ </div>
+
+ {/* ── Bottom: contact strip ── */}
+ <div>
+ <XDSDivider />
+ <div className="ftc-footer-grid">
+ {CONTACT_COLUMNS.map(col => (
+ <XDSVStack key={col.label} gap={1} hAlign="center">
+ <XDSText type="supporting" color="secondary">
+ <span className="ftc-footer-label">{col.label}</span>
+ </XDSText>
+ <XDSLink
+ label={col.email}
+ href={`mailto:${col.email}`}
+ type="body"
+ size="sm">
+ {col.email}
+ </XDSLink>
+ </XDSVStack>
+ ))}
+ </div>
+ </div>
+
+ </div>
+ </div>
+ );
+}
diff --git a/packages/cli/templates/form-two-column/template.doc.mjs b/packages/cli/templates/form-two-column/template.doc.mjs
new file mode 100644
index 0000000000..8f71dfd3d7
--- /dev/null
+++ b/packages/cli/templates/form-two-column/template.doc.mjs
@@ -0,0 +1,6 @@
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
+export const doc = {
+ name: 'Form (Two-Column)',
+ description: 'Hero header with form card layout for data collection',
+ isReady: true,
+};