Skip to content
Start free

Text

A text box holds rich text: paragraphs and lists, with formatting and fields from your data.

PropertyRequiredDescription
contentYesThe rich text
overflowNoWhat happens when the text is too long for the box: grow (the default), fixed or shrink
minFontSizeNoThe smallest size shrink goes to. Half the font size when left out
verticalAlignNotop (the default), middle or bottom
fontNoThe box’s text style (Fonts), on top of the page’s
styleNoA box style
  • grow: the box grows to fit its text and pushes what’s below it down. Its height is the least height it has.
  • fixed: the box keeps its height, and text that doesn’t fit is cut off.
  • shrink: the box keeps its height, and the text gets smaller until it fits, down to minFontSize. Text that still doesn’t fit at that size is cut off.

overflow only matters for a box with a height. A text box in a stack or column without one is as tall as its text.

A name on a certificate, centered in its box, that gets smaller for a long name:

{
"id": "recipient_name",
"type": "text",
"x": 60,
"y": 220,
"width": 420,
"height": 48,
"overflow": "shrink",
"minFontSize": 18,
"verticalAlign": "middle",
"font": { "family": "Great Vibes", "size": 40 },
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": { "align": "center" },
"content": [
{ "type": "field", "attrs": { "expression": "recipient.name" } }
]
}
]
}
}