Gallery

71 figures · Open a figure to explore its code.

layout (11)

geometry (10)

plotting (16)

maps (9)

networks (6)

text (5)

math (12)

api (2)

(stack_alignment)

Baselines, packing, and stretch

The first row aligns mixed-size text on a common baseline; the Square uses its bottom edge because it has no baseline guide. The second distributes free space between fixed-size items. In the last row, the blue bar stretches to the height of the paragraph after its width is allocated and its words reflow.

TextBox and TextCol carry the available width through the surrounding document. The final row explicitly uses align="stretch" to demonstrate its separate vertical allocation policy.

Try a narrower SVG width to inspect the stretch behavior. Cross-axis alignment and main-axis packing are independent; see HStack and Stack for their props.