Sections & Variables
A template’s content is an ordered list of sections. Each section:
- has a
schemaType— what kind of content it holds:html,table, orcanvas; - has a
uiType— which builder tool edits it:visual_editor,code_editor,table_builder, orcanvas_builder; - has an
order(starting at 1) — sections render top to bottom in this order; - has a
dataKey— the key in your renderdataobject this section reads from; - may carry
layoutproperties for PDF flow (height, width, spacing,pageBreakInside: 'avoid', …).
The template itself can also define page margins (top/right/bottom/left, in pixels).
HTML sections
Rich content with {{variable}} placeholders (Handlebars-style), authored in the visual editor or as raw HTML in the code editor:
<h1>Invoice {{invoice_number}}</h1>
<p>Billed to {{customer_name}} on {{date}}</p>Each HTML section declares a dataSchema describing the variables it uses — type (text, date, number), label, required flag, placeholder. Optional styling controls background, text, heading, and link colors.
Table sections
A typed column definition fed by an array in your render data. Each column has:
| Property | Values |
|---|---|
name | key in each row object |
label | header text |
type | string · number · date · currency · formula |
width, align | optional presentation (left/center/right) |
A table section with dataKey: "employees" and columns name, role, salary consumes:
{
"employees": [
{ "name": "Ada Lovelace", "role": "Engineer", "salary": 9000 },
{ "name": "Grace Hopper", "role": "Admiral", "salary": 9500 }
]
}XLSX output renders table sections only. Rendering a template to xlsx when it has no table sections fails with 400 No table sections found. PDF renders all section types.
Canvas sections
Free-form, absolutely positioned layout — a fixed-size canvas (px) holding elements of type text, image, table, or spacer, each with x/y/width/height and type-specific props (content supports {{variable}} placeholders, plus font size, bold, color). Best for certificates and badge-style documents where exact positioning matters.
Variables
Variables are the typed contract between a template and your render call:
| Type | Expects in data |
|---|---|
text | string |
date | date string (e.g. "2026-07-19") |
number | number |
items-table | array of row objects, matching the variable’s columns (name, label, inputType: text/number/date) |
Every variable has a name (the data key), a label, and a required flag. At render time you pass one flat data object whose keys are variable names / section data keys — the invoice tutorial shows a realistic payload.