Skip to content
LpdfDocsv0.24-r1004.10

Lpdf is pre-release. The XML schema and SDK APIs can change between releases.

Grid

A multi-column grid. Children fill columns left-to-right and wrap to new rows. Grid rows are atomic — a row will not split across pages.

Use grid for uniform card layouts. For tabular data with column headers, use table instead.

Attribute Type Default Description
cols integer 1 Number of columns (1–12)
col-width token/pt — Minimum column width: the grid fits as many columns as the width allows, at least one, and stretches them to fill the row (overrides cols)
gap token/pt — Gap between cells
width token/pt — Constrain total width
padding spacing — Inner padding
background color — Background color
border string — Border
radius token/pt — Corner radius
font string inherit Font name
font-size token/pt inherit Font size
data-source string — Dot-path to array — repeats children per item
<grid cols="3" gap="m">
<frame padding="m" border="xs #e0e0e0" radius="s">
<stack gap="4pt">
<text font-size="s">Feature A</text>
<text font-size="xs" color="#666666">Short description.</text>
</stack>
</frame>
<frame padding="m" border="xs #e0e0e0" radius="s">
<stack gap="4pt">
<text font-size="s">Feature B</text>
<text font-size="xs" color="#666666">Short description.</text>
</stack>
</frame>
<frame padding="m" border="xs #e0e0e0" radius="s">
<stack gap="4pt">
<text font-size="s">Feature C</text>
<text font-size="xs" color="#666666">Short description.</text>
</stack>
</frame>
</grid>
<grid cols="2" gap="m" data-source="products">
<frame padding="m" border="xs #e0e0e0" radius="s">
<stack gap="4pt">
<text font-size="s" data-value="name">Product name</text>
<text font-size="xs" color="#666666" data-value="price">$0.00</text>
</stack>
</frame>
</grid>