Skip to content

Form Association (FACE) Playbook

A Contact Form demonstrating Form Associated Custom Elements (FACE) across React, Vue, and Lit — ag-input, ag-selection-button-group, and ag-toggle submitting natively with the parent <form>, programmatic validation via form.elements, and form.reset() restoring all fields without manual state management.

New to FACE?

Read the Form Association guide first — it explains the core concepts, framework-specific gotchas, and how to inspect FACE in action.

Working Examples

Three complete implementations are available in the repository:

FrameworkSourceRun
Reactreact-example/cd react-example && npm install && npm run dev
Vuevue-example/cd vue-example && npm install && npm run dev
Litlit-example/cd lit-example && npm install && npm run dev

Each example logs form.elements, the validateAll result, and the FormData entries to the console so you can watch FACE work in real time.

Form Fields

FieldnameComponentValidation
Full NamefullNameag-input (text)required
Email Addressemailag-input (email)required
Phonephoneag-input (tel)optional
Messagemessageag-input (textarea)required
Newsletter frequencyfrequencyag-selection-button-group (radio)required
Terms & Conditionstermsag-togglerequired

Components Used

ComponentPurpose
ag-inputText, email, tel, and textarea fields (FACE-enabled)
ag-selection-button-groupRadio group for newsletter frequency (FACE-enabled)
ag-toggleTerms acceptance checkbox (FACE-enabled)
ag-buttonSubmit and Clear actions
ag-cardForm and result containers
ag-dividerVisual separator

Generate Your Own with an LLM

Use the PROMPT files to build a Contact Form from scratch:

PromptOutputUse when
PROMPT-3-FRAMEWORKS.mdreact-example/, vue-example/, lit-example/Build all three at once
PROMPT-REACT.mdReact appReact only
PROMPT-VUE.mdVue appVue only
PROMPT-LIT.mdLit appLit only
bash
cd v2/playbooks/form-association
claude  # or your LLM of choice

# Then ask:
> Please follow the instructions in PROMPT-3-FRAMEWORKS.md

Further Reading