Box

The <box> element is a container that wraps its children with padding, background color, and optional borders. It's useful for visually grouping content or creating highlighted sections.

Example

<box 
  backgroundColor="#f0f0f0" 
  leftPadding="10mm" 
  rightPadding="10mm"
  topPadding="5mm"
  bottomPadding="5mm"
  borderColor="black"
  borderWidth="1"
>
  <text>This content is inside a box with padding and a border.</text>
  <field title="Name" type="box_below">{{person.name}}</field>
</box>

Attributes

backgroundColor (optional)

The background color of the box. Can be a named color (e.g., red, white, black) or an RGB value (e.g., rgb(255, 10, 10) or #ff0a0a).

leftPadding (optional)

Padding on the left side of the box. Can be specified in pt, mm, or cm (e.g., 10mm).

rightPadding (optional)

Padding on the right side of the box. Can be specified in pt, mm, or cm.

topPadding (optional)

Padding on the top of the box. Can be specified in pt, mm, or cm.

bottomPadding (optional)

Padding on the bottom of the box. Can be specified in pt, mm, or cm.

borderColor (optional)

The color of the box border. Can be a named color or RGB value.

borderWidth (optional)

The width of the box border in points (pt). Default is no border.

Allowed Children

A <box> can contain the following elements:

  • <columns>

  • <field>

  • <image>

  • <keepTogether>

  • <line>

  • <pageBreak>

  • <rect>

  • <space>

  • <table>

  • <text>

chevron-righthashtag

Last updated

Was this helpful?