Form

Transform Markdown into fully functional, accessible HTML forms. Lists become input fields with types inferred from their names, blockquotes introduce selection groups, and headings create fieldsets.

Basic usage

List items are automatically mapped to the correct input types based on their names.

{% form action="https://formspree.io/f/example" %}
- Name
- Email
- Message

**Send**
{% /form %}

Fieldset groups

Headings create <fieldset> sections with legends.

{% form action="/api/contact" %}
## Contact Info

- Name
- Email
- Phone (optional)

## Your Message

- Message

**Submit**
{% /form %}

Selection fields

A blockquote followed by a list creates a selection group. With 4 or fewer options, it renders as radio buttons. Add (multiple) for checkboxes.

{% form action="/api/signup" %}
- Name
- Email

> What interests you? (multiple)

- Web Design
- Branding
- Consulting
- Development

> Preferred contact method

- Email
- Phone
- No preference

**Sign Up**
{% /form %}

Style variants

Use the style attribute to change the layout.

{% form action="/api/subscribe" style="inline" %}
- Email (placeholder: "you@example.com")

**Subscribe**
{% /form %}

Attributes

AttributeTypeDefaultDescription
actionstringForm submission endpoint URL (required)
methodstringPOSTHTTP method: GET or POST
successstringMessage shown on successful submission
errorstringMessage shown on failed submission
stylestringstackedLayout: stacked, inline, compact
namestringForm identifier for multi-form pages
honeypotbooleantrueAuto-generate honeypot spam field

Smart type inference

Field types are automatically inferred from the list item text:

Field name containsInput type
email<input type="email">
phone, mobile, tel<input type="tel">
website, url<input type="url">
date, birthday<input type="date">
number, amount, quantity<input type="number">
password, pin<input type="password">
message, comments, description<textarea>
file, upload, attachment<input type="file">
anything else<input type="text">

Field modifiers

Add parenthetical modifiers to list items:

  • (optional) — removes the required attribute
  • (placeholder: "hint text") — adds placeholder text

Example: - Phone (optional, placeholder: "+1 555-0100")