Skip to main content
A container groups children and arranges them with a flow or flex layout. Build one with page.create_container, add children with container.add, then add the container to the page. Children flow or flex inside the container’s padded area.

Container layout

A flow layout stacks children vertically with an optional gap. A flex layout distributes children along a row or column. Containers also accept style, width, height, position, and classname.

Flow

Flow is the simplest layout. Children stack from top to bottom, separated by gap.

Flex

Flex distributes children along a row or column and controls how spare space is shared.

Justify

justify controls distribution along the main axis.
FlexJustify
One of flex-start, flex-end, center, space-between, space-around, space-evenly.

Align

align controls placement along the cross axis.
FlexAlign
One of flex-start, flex-end, center, stretch, baseline.

Adding children

Use container.add(...elements) to place children. They flow or flex inside the container’s padded area according to its layout.
Size a full width container with page.get_content_width() so it spans the usable area inside the page margins.

Elements

The text, rectangle, and image primitives you add to a container.

Tables

Structured rows and columns with the table factory.