Grid

A grid turns a list into a row of cards. It is the construct for feature lists, pricing tiers, and anything that reads as "a set of parallel items". The content must be exactly one list, which is what guarantees the degradation: on a renderer that has never heard of Markset, the grid is the list.

cols runs from 1 to 4 and renderers reduce it at narrow widths. Items may contain nested blocks.

Attributes

Attribute Values Default
cols 1 to 4 2
gap sm md lg md

Content must be exactly one list, ordered or unordered; anything else is an error. That single rule is what guarantees the fallback, and it is why a grid cannot hold loose paragraphs or two lists.

Downgrade: the list, unchanged.

Watch for: cols is a maximum, not a promise. A renderer reduces it on a narrow screen and the breakpoints are its business, not the document's.

Examples

Content must be exactly one list. That single rule is what makes the downgrade trivially exact: drop the fence and a list is still a list.

canonical

Source

:::grid{cols=3 gap=md}
- **Fast** — sub-50 ms cold start
- **Small** — 4 kB gzipped
- **Typed** — no `any` in the public API
:::

Rendered

Fast — sub-50 ms cold start

Small — 4 kB gzipped

Typed — no any in the public API

Downgrade

- **Fast** — sub-50 ms cold start
- **Small** — 4 kB gzipped
- **Typed** — no `any` in the public API

cols accepts 1 to 4. The stylesheet collapses to fewer columns on a narrow screen; the document does not say when.

every cols value

Source

:::grid{cols=1}
- a
:::

:::grid{cols=4 gap=lg}
- a
:::

Rendered

a

a

Downgrade

- a

* a

An item may hold several blocks, so a grid item can be a small article rather than a line.

items with nested blocks

Source

:::grid
- a
  - inner
- b
:::

Rendered

a

  • inner

b

Downgrade

- a
  - inner
- b

An ordered list works too. The marker is not rendered, so use whichever reads better in the raw source.

ordered list is allowed

Source

:::grid
1. a
2. b
:::

Rendered

a

b

Downgrade

1. a
2. b

What the validator catches

Every error below is specified; nothing degrades silently.

empty content

invalid

Source

:::grid
:::

Rendered

Diagnostics: GRID_CONTENT

wrong content type: paragraph

invalid

Source

:::grid
not a list
:::

Rendered

not a list

Diagnostics: GRID_CONTENT

wrong content type: two lists

invalid

Source

:::grid
- a

* b
:::

Rendered

  • a
  • b

Diagnostics: GRID_CONTENT

All 16 cases for grid are in the conformance browser. The normative text is spec §4.