Skip to content

Forms written in Markdown

A :::form lives in any scene of any story. It renders as a native HTML form that works without JavaScript, and as an accessible interactive form when JavaScript runs. Its answers go to your API, which follows the Form Submission API: Récit hosts nothing.

This demo plays the API's answer you pick. Nothing is sent: every form on this site runs in mock mode.

Answer of the API

Demo: nothing is sent.

Attendance(required)

We use your answers only for this form. Privacy notice

Request sent

Nothing sent yet.

The source

Markdownmeetup.md
:::form{#meetup endpoint=https://api.example.com/v1/forms privacy=/privacy} ::field[Your name]{name=name required autocomplete=name maxlength=120} ::field[Email]{name=email type=email required autocomplete=email} ::field[Attendance]{name=mode type=radio required options="onsite=On site,remote=Remote"} ::field[Company]{name=company visible-if="mode=onsite" required-if="mode=onsite" maxlength=120 help="Only if you come on site."} ::consent[I agree to be contacted about this meetup]{name=consent required version=2026-11} ::submit[Register] :::success Thanks, lorem ipsum: see you at the meetup. ::: :::

The same form is a typed JSON object in the story's twin (FormBlockSchema of @recit/core/schema), so recit convert turns one into the other without losing anything.

What the block gives you

  • Native first: labels always visible, HTML constraints (required, maxlength, type=email), and a plain <form method="post"> with submit=native.
  • Accessible: an error summary that takes the focus, aria-invalid and aria-describedby on each field, a live region for the state of the submission.
  • Your API: urlencoded by default (no CORS preflight), multipart with a file, JSON with encoding=json. The API's errors (RFC 9457, errors[] with a pointer) land on their fields.
  • No tracker: a honeypot and a time trap, no third party. The build refuses a secret in the source and warns about personal data collected without ::consent.
  • Two languages: labels by name, messages in English and French, checked by recit i18n check.

Go further

Start from the template: examples/form-contact (en/fr), and examples/form-api-node for a reference server on node:http.