Skip to main content

lazy-layout

Make multiple blocks match the size of the tallest (or widest) sibling without expanding to fill the entire page.

  • direction: ttb (default): equalizes block heights via lazy-v.
  • direction: ltr: equalizes block widths via lazy-h.

If a column (or row) contains multiple lazy markers (stacked blocks), only the last one is activated.

Use cols(lazy-layout: true) as a convenient shorthand for the vertical case.

#lazy-layout(grid(
columns: (1fr, 1fr),
block(width: 100%)[
#lorem(10)
#lazy-v(1fr)
Bottom left.
],
block(width: 100%)[
#lorem(20)
#lazy-v(1fr)
Bottom right.
],
))
Parameters

direction : direction    default: ttb

The equalization axis (ttb/btt for heights, ltr/rtl for widths). Default is ttb.

grid-size : length    default: 50pt

The quantization unit for grouping markers into the same column (vertical mode) or row (horizontal mode). Positions are floored to the nearest multiple of grid-size before comparison, adding tolerance for sub-pixel differences. Default is 50pt.

body : content

The content containing lazy-v or lazy-h markers.

Returns: content