Skip to content
LpdfDocsv0.24-r1004.10

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

Stack

Stacks children vertically with a configurable gap. By default each child fills the available width.

Attribute Type Default Description
gap token/pt — Space between children: xs s m l xl xxl or 12pt
align string stretch Cross-axis alignment: start center end stretch
justify string start Main-axis distribution: start center end between
width token/pt — Constrain width
padding spacing — Inner padding: 16pt or shorthand "16pt 12pt"
background color — Background color
border string — Border: "s #cccccc" or "1pt #cccccc"
radius token/pt — Corner radius
height pt/fill/full — Fixed height, fill remaining space, or full page height
font string inherit Font name (declared in assets)
font-size token/pt inherit Font size for all children
data-source string — Dot-path to array — repeats this element per item
data-if string — Render only when value is truthy
data-if-not string — Render only when value is falsy
<stack gap="16pt">
<text font-size="18pt">Title</text>
<divider/>
<text>Body text.</text>
</stack>
<stack gap="12pt" align="center">
<text>Centered item</text>
<text>Also centered</text>
</stack>

Space between (like flex justify-content: space-between)

Section titled “Space between (like flex justify-content: space-between)”
<stack justify="between" height="full">
<text>Top</text>
<text>Bottom</text>
</stack>
<stack gap="8pt" padding="m" background="#f8f9fa" border="xs #e0e0e0" radius="s">
<text font-size="s">Card title</text>
<text font-size="xs" color="#666666">Supporting text.</text>
</stack>