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.
Request sent
Nothing sent yet.
The source
meetup.md
The same form is a typed JSON object in the story's twin (FormBlockSchema of @recit/),
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=with"post"> submit=.native - Accessible: an error summary that takes the focus,
aria-invalidandaria-on each field, a live region for the state of the submission.describedby - Your API: urlencoded by default (no CORS preflight), multipart with a file, JSON with
encoding=. The API's errors (RFC 9457,json errors[]with apointer) 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 byrecit i18n check.
Go further
- Writing a form: every directive, attribute and rule.
- The Form Submission API: the contract, the TODO API checklist and recipes for a Worker, a Vercel function or an API gateway.
- The gallery: more forms, one per pattern.
- The OpenAPI document: the contract, rendered from its JSON.
Start from the template: examples/ (en/fr), and examples/ for a
reference server on node:http.