Skip to main content

lazy-h

Insert a deferred fractional horizontal space inside a block, used together with lazy-layout(direction: ltr) (or any horizontal direction) to push content to the right edge of a block while keeping all sibling blocks at equal width.

The horizontal counterpart of lazy-v. Place lazy-h(1fr) between the leading content and the trailing content inside a block. When the block is rendered inside a lazy-layout with a horizontal direction, the space expands to fill the remaining width of the widest sibling block, so all blocks end up the same width and their trailing content aligns at the right edge.

Without a lazy-layout with a matching horizontal direction, this marker has no visual effect.

Example:

#components.lazy-layout(
direction: ltr,
stack(
dir: ltr,
block(height: 100%)[
Left label. #components.lazy-h(1fr) Right label.
],
block(height: 100%)[
A longer left label. #components.lazy-h(1fr) Right label.
],
),
)
Parameters

amount : fraction

The fractional amount of space. Must be a fraction (e.g. 1fr).

weak : bool    default: false

Whether the space is weak (collapses with adjacent spaces). Default is false.

Returns: content