TypstDocumentation

stackElement
Question mark

Arrange content and spacing horizontally or vertically.

The stack places a list of items along an axis, with optional spacing between each item.

Example

#stack(
  dir: ttb,
  rect(width: 40pt),
  rect(width: 120pt),
  rect(width: 90pt),
)
Preview

Parameters
Question mark

dir
direction
Settable
Question mark

The direction along which the items are stacked. Possible values are:

Default: ttb

spacing
none or relative length or fraction
Settable
Question mark

Spacing to insert between items where no explicit spacing was provided.

Default: none

children
relative length or fraction or content
RequiredPositional
Question mark
Variadic
Question mark

The children to stack along the axis.