Form

beta

Drop-in form module. Editors build the fields in Sanity (text, email, phone, long text, dropdown, checkbox); submissions are emailed via Resend to the recipients set on the block. Submitting here shows the success state without sending anything.

Live Preview

Get in touch

CONTACT THE LEAGUE

Questions about membership, fixtures or anything else — send us a note and the league office will reply within two working days.

tsx
<FormBlock
/>
Controls
background

Surface tone — also drives field and text contrast.

fillScreen
false

Fill the viewport below nav + ticker and centre the form vertically.

eyebrow
headline
intro
submitLabel
successTitle
successMessage
Props
PropTypeDefaultDescription
background"cream" | "white" | "surface" | "navy" | "gold" | "none""cream"Surface tone. Drives text, field and focus colours. `none` is transparent and sits on the (dark) site background.
fillScreenbooleanfalseSection is at least the viewport height minus nav + ticker (147px), with the form centred vertically.
eyebrowstring"Get in touch"Small uppercase label above the headline. Empty string hides it.
headlinestring"CONTACT THE LEAGUE"Section headline in Barlow Condensed.
introstring—Optional paragraph below the headline.
fieldsFormField[]demo set`{ name, label, type, required?, placeholder?, options?, width?, helpText? }`. Types: text, email, tel, textarea, select, checkbox. `width: "half"` pairs fields from 640px up.
submitLabelstring"Send message"Text on the submit pill.
successTitlestring"Message sent"Heading shown in place of the form after a successful submit.
successMessagestring—Copy under the success heading.
action(prev, data: FormData) => Promise<FormBlockState>demo (fake success)Server action that delivers the submission. Return `{ error }` or `{ fieldErrors: { [name]: msg } }` to show messages; `{ success: true }` swaps in the success state.
formKeystring—Sent to the action as hidden `_formKey`. The website uses `<documentId>:<blockKey>` so the server can look up recipients in Sanity.
Accessibility
  • • Every control has a real <label>; optional fields are marked “(optional)” rather than starring required ones.
  • • Help text and errors are linked with aria-describedby; invalid fields get aria-invalid.
  • • The form-level error is role="alert"; the success panel is role="status".
  • • Inputs are 16px on phones so iOS Safari doesn't zoom on focus.
Usage Notes
  • • Single column on phones; half-width fields pair up from 640px.
  • • Inputs keep their values when the server returns an error — submission goes through onSubmit, not the form action attribute, so React doesn't reset the fields.
  • • Includes a hidden honeypot field (company_website); the website action drops submissions that fill it.