Skip to main content

text

A single styled string. The most common node by far.
A text value can mix literal text and tokens freely: "Total due: {{invoice.total}}".

style

The style object controls typography. Every field is optional; a node’s style merges over the page’s defaultTextStyle.
Only fontSize and color inherit from page.defaultTextStyle. bold, semiBold, and italic take effect only on the node where you set them — so a page default never silently bolds everything. Set the weight on each node that needs it.

Colours

A colour is either a hex string or a named palette token.
#RGB, #RRGGBB, or #RRGGBBAA (3, 6, or 8 hex digits; case-insensitive). The 8-digit form includes alpha.
For brand colours, use hex. For quick, harmonious greys and accents on internal documents, the palette tokens save you picking values — grey.darken1 for muted labels, grey.lighten2 for hairline borders are common choices.

richText

When one line needs more than one style, or a dynamic page number, use richText instead of text. It’s a sequence of spans laid out inline.
A span is one of three shapes:
pageNumber and totalPages are the only way to print page numbers, and they only make sense in a footer or header (which repeat on every page). In the body they’d render once. See Headers & footers.

Next: Tables

Repeat rows over an array in your data.