HTML reference
The full HTML form of every document model type: tag, how Format identifies it, placement, and attributes.
The canonical HTML form of every document model type: tag, how Format identifies it, fields, and placement.
Who uses this
Use this page when you author Format's HTML directly, build tools that emit or consume the model (codegen, validators, LLM document generators), or inspect the HTML the SDKs render. Most React and Vue components map onto a type here, but the match is not total: Frame is a data-type="frame" attribute you add to your own element rather than a component, and PageBreak renders a bare marker template. The TypeScript definitions for @format.dev/react and @format.dev/vue are authoritative for the component props; this page is authoritative for the underlying HTML.
How elements are classified
When Format parses your HTML, every model type is identified by its data-type attribute. A <template data-type="layout"> is a Layout, a <template data-type="flow"> is a Flow, a <template data-type="stream"> is a Stream, a <div data-type="frame"> is a Frame, and the shared <template> markers carry the data-type that names them.
Placement does not change classification: a <template data-type="layout"> is a Layout wherever it sits in your document, and a generic <template> with no matching data-type stays plain markup.
A hand-authored document must also set data-engine on its root <template data-type="document">, naming the engine version Format renders it on. See Document versions.
When the SDK and the schema disagree
The React and Vue SDKs sometimes narrow the accepted types. Two examples:
- The React
<Layout width={...} />prop takes anumber; the underlyingdata-widthis a CSS px-length string, and the SDK adds thepxsuffix. - A React
<Flow splitGranularity="sentence">prop takes a string literal type; the underlyingdata-split-granularityis the same string with the same value.
The TypeScript definitions for @format.dev/react and @format.dev/vue are authoritative for the component props. The schema here is authoritative for the underlying HTML form. When your tool emits the HTML directly (LLM document generators, server-side template engines), match the schema; when you work through the SDK, write against the TypeScript definitions.
Validating against the schema
The full schema lives at model.schema.json in the @format/engine package. It uses JSON Schema draft 2020-12. You can validate rendered HTML against it programmatically, which catches malformed documents in CI before they reach Format.
Related
Document model · Errors · Pagination
Types
Counter
Tag: <span> · Identified by data-type="counter"
Placement: Anywhere within Flow
| Attribute | Field | Format | Required |
|---|---|---|---|
data-name | name | string | ✓ |
data-action | action | enum variant | — |
data-value | value | integer | — |
data-join | join | string | — |
data-counter-style | counterStyle | string | — |
CounterDef
Tag: <template> · Identified by data-type="counter-def"
Placement: Direct child of Numbering
| Attribute | Field | Format | Required |
|---|---|---|---|
data-name | name | string | ✓ |
data-reset-each | resetEach | string | — |
Document
Tag: <template> · Identified by data-type="document"
Placement: Top-level
| Attribute | Field | Format | Required |
|---|---|---|---|
data-title | title | string | ✓ |
data-subject | subject | string | — |
data-author | author | string | — |
data-keywords | keywords | string | — |
data-fonts | fontMode | enum variant | — |
Flow
Tag: <template> · Identified by data-type="flow"
Placement: Anywhere within Layout or Frame or Flow
| Attribute | Field | Format | Required |
|---|---|---|---|
data-split-granularity | splitGranularity | enum variant | — |
data-pagination-strategy | paginationStrategy | enum variant | — |
data-scope | scope | string | — |
Footnote
Tag: <template> · Identified by data-type="footnote"
Placement: Anywhere within Flow
No attributes.
Footnotes
Tag: <template> · Identified by data-type="footnotes"
Placement: Anywhere within Layout or Flow
| Attribute | Field | Format | Required |
|---|---|---|---|
data-counter-style | counterStyle | string | — |
data-restart-each-page | restartEachPage | boolean | — |
data-repeat-head | repeatHead | boolean | — |
Frame
Tag: any element with layout · Identified by data-type="frame"
Placement: Anywhere within Layout
| Attribute | Field | Format | Required |
|---|---|---|---|
data-id | id | string | ✓ |
Layout
Tag: <template> · Identified by data-type="layout"
Placement: Direct child of Document
| Attribute | Field | Format | Required |
|---|---|---|---|
data-id | id | string | ✓ |
data-width | width | CSS px length | ✓ |
data-height | height | CSS px length | ✓ |
data-pagination-strategy | paginationStrategy | enum variant | — |
data-split-granularity | splitGranularity | enum variant | — |
Numbering
Tag: <template> · Identified by data-type="numbering"
Placement: Direct child of Document
| Attribute | Field | Format | Required |
|---|---|---|---|
data-counter-style | counterStyle | string | — |
NumberingRule
Tag: <template> · Identified by data-type="numbering-rule"
Placement: Direct child of Numbering
| Attribute | Field | Format | Required |
|---|---|---|---|
data-match | selector | string | ✓ |
data-counter | counter | string | — |
data-increment | increment | integer | — |
data-set | set | integer | — |
data-format | format | string | — |
data-counter-style | counterStyle | string | — |
data-insert | insert | enum variant | — |
PageBreak
Tag: <template> · Identified by data-type="page-break"
Placement: Anywhere within Flow
No attributes.
Ref
Tag: <span> · Identified by data-type="ref"
Placement: Anywhere within Flow
| Attribute | Field | Format | Required |
|---|---|---|---|
data-to | to | id reference | ✓ |
data-counter | counter | string | — |
data-page | page | boolean | — |
data-counter-style | counterStyle | string | — |
Stream
Tag: <template> · Identified by data-type="stream"
Placement: Anywhere within Flow
No attributes.
TableOfContents
Tag: <template> · Identified by data-type="toc"
Placement: Anywhere within Flow
| Attribute | Field | Format | Required |
|---|---|---|---|
data-collect | collect | string | — |
data-leader | leader | enum variant | ✓ |
data-repeat-head | repeatHead | boolean | — |