Organism · beta · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: The form
Rendered by contact-form.tsOpen example: Contact form · Do: The form Use the full-page example to follow page links.
Do: With its promise
Rendered by contact-form.tsOpen example: Contact form · Do: With its promise Use the full-page example to follow page links.
Don't: Embedded elsewhere
Rendered by contact-form.tsOpen example: Contact form · Don't: Embedded elsewhere Use the full-page example to follow page links.
Don't: Without its privacy note
Rendered by contact-form.tsOpen example: Contact form · Don't: Without its privacy note Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| Contact form is computed by Loom's code from the visitor's own message, sent to POST /api/contact (functions/api/contact.ts) after a Turnstile check, not drawn by hand. | A showcase is proof only if the product's own code produced what it shows. | Automated: scripts/site/interactives/check.ts (recomputes the showcase data and fails on drift) |
| The form states what happens to the reader's data next to where they enter it. | Trust: nothing is sent without the reader knowing. | Automated: tests/site/contact-form.spec.ts |
API
No props.
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | contact-form |
| Layer | Organisms |
| Category | app |
| Owner | Site system lead |
| Status | beta |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/organisms/contact-form.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | Contact form: computed by Loom's code from the visitor's own message, sent to POST /api/contact (functions/api/contact.ts) after a Turnstile check. |
Use when
- /contact/ and /ja/contact/. Why: No email address is published: the form is the way in.
Do not use when
- Embedded in a marketing page. Why: Pages link to /contact/; the form keeps its own page and script.
Anatomy
| Part | What it is |
|---|---|
| intro | section.contact-intro: h1, lede, privacy line |
| panel | section.panel.panel-form: required note, error summary, status, the form (fields, topic choices, message, honeypot, consent, spam check, submit), done message |
Made of: showcase-frame, panel, form-field, button, heading, text.
Used in: task-body, page-apps.
Variants
| Variant | When | Why |
|---|---|---|
| full | On its demo page and its section. | The whole experience where the claim is made. |
States
| State | Rendered or not applicable |
|---|---|
| default | Build-time contact fields, required/privacy notes and hidden confirmation. contact/contact.js owns validation and submission on its full task page. |
| hover | Native fields, choices, links and submit button use their own hover affordances. |
| focus-visible | Task controls show focus. Invalid submission focuses the linked error summary; successful submission focuses the confirmation heading. |
| active | The reader chooses a topic/consent and submits; there is no timed playback or Pause control. |
| disabled | The real submit button is natively disabled while POST /api/contact is pending, then re-enabled after a failed send. |
| loading | Task-owned spam-check status and pending submit label/live status are separate from component mounting. The form remains build-time markup; it has no managed showcase initializer. |
| empty | Blank required fields remain editable; submit creates associated field errors and a focused summary. Optional company/role may remain empty. |
| error | Invalid fields use aria-invalid and linked descriptions. A failed request never shows success and retains the message for retry. Spam failures expose the existing retry control. Boot errors are logged; no host remount recovery is promised. |
| current | The selected topic radio and consent checkbox expose their native checked state; no current-frame slider exists. |
| visited | Not applicable: No visited state on this root; any contained native links retain their own browser history. |
| expanded | Not applicable: No disclosure state on this root; replacing a view is not aria-expanded. |
Tokens
| Part | Token |
|---|---|
| panel.background | --surface |
| field.border | --line-strong |
| error.color | --madder-ink |
| --contact-form-gap-grid-gap | var(--grid-gap) |
| --contact-form-padding-space-9 | var(--space-9) |
| --contact-form-padding-space-8 | var(--space-8) |
| --contact-form-font-type-h2 | var(--type-h2) |
| --contact-form-letter-spacing-ls-h2 | var(--ls-h2) |
| --contact-form-margin-top-space-7 | var(--space-7) |
| --contact-form-gap-space-5 | var(--space-5) |
| --contact-form-gap-space-9 | var(--space-9) |
| --contact-form-color-field-fg-2 | var(--field-fg-2) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; columns stack under 768 px and controls fill the row on phones. |
| wrapping | Text wraps; code panes scroll inside their own focusable region. |
| textExpansion | Japanese strings come from the i18n tables and wrap; engine output stays English. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | Inside the Showcase frame's padding, controls and caption at its foot. |
| external | Full width of its section. |
| rhythm | One showcase per section, after the section's claim (D-SITE-008). |
Motion
| Aspect | Value |
|---|---|
| None | This task form has no intrinsic timed sequence or autoplay; native focus/hover rules and page-shell entrance policy remain separate. |
Runtime and reuse
Render-only element; mount any registered child enhancements separately. Preserve required Site CSS, fonts, responsive and locale rules from nativeElement.
Accessibility passport
| Aspect | Value |
|---|---|
| role | Native form with labelled fields, topic fieldset, error summary, status and confirmation sections. |
| name | Its heading or caption |
| keyboard | Tab through fields/choices/links/buttons; Enter submits; the existing spam-check retry is keyboard operable. |
| focus | Validation focuses the linked error summary; successful send focuses the confirmation heading. |
| screenReader | Required labels, associated invalid-field messages, task statuses and confirmation; no playback announcements. |
| contrast | Ink on surface 14:1; state dyes only as marks with words. |
| target | Controls are 44 px. |
Content
| Slot | Length | Voice |
|---|---|---|
| label | 4 words | Plain, second person |
Good: “Your message”
Bad: “Submit inquiry”
Japanese: Japanese strings from contact/i18n/ja.json, filled at build time on /ja/contact/.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
8 uses across the built pages (measured by npm run site:system).
Tests
| Aspect | Value |
|---|---|
| unit | tests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns |
| visual | Not yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts |
| a11y | tests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark |
| parity | scripts/site/system/check.ts: Library examples are rendered by the same render function the site imports |
Figma
not-yet: The Loom Site Figma library is the last stage of the plan; this element is not mapped yet.