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_flex)

Flex limits and shrinkage

The first row divides free space with growth weights of 1:2:1. The next row caps the middle item at 120px and redistributes the remaining space to its neighbors. The third row shrinks two 300px bases to fit the available width and gap. The final row uses Spacer to push a fixed-size item to the end.

The outer TextBox and nested TextCol components supply a shared width without repeating width declarations. Each HStack still allocates its bars using their grow, shrink, and limit props. The unsized growing bars start from zero automatically; the shrinking bars explicitly supply their 300px bases.

These are allocations of ordinary Box children; their label fonts stay fixed. See Stack for basis, grow, shrink, and min/max rules, or Layout choices for a simpler comparison of growth weights.