Skip to main content

Container

A width-constrained wrapper around other blocks — Section without the dividers and effects.

The block renders through the container element — the same PHP that runs in the page builder, so the front end is identical either way.

What the sidebar exposes

OptionWhat it does
is_fullwidthRun edge to edge
min_heightMinimum height
column_halignHorizontal alignment of the columns
column_valignVertical alignment of the columns
reverse_columnsReverse the column order
backgroundThe full background stack
background_patternAn overlaid pattern
padding_topSpace above
padding_bottomSpace below
gapSpace between columns
gap_xHorizontal gap
gap_yVertical gap

Anything not listed stays available in the page builder, and round-trips untouched.

A container previews as an outline, not as itself

Every other Unyson+ block previews with a server-rendered picture of the finished element. A container cannot: its purpose is to hold other blocks, and those have to stay editable in place.

So the canvas shows a neutral dashed outline with the real, editable children inside — not the element's background, padding, width or design preset. Those are applied by PHP on the front end.

That is deliberate. Approximating the wrapper's styling in JavaScript would be a second implementation of the element's CSS, guaranteed to disagree with the first the moment either changes. An outline that is honestly neutral beats a preview that is subtly wrong. Preview the page to see the real thing.

The children reach PHP the same way the page builder's do

save() stores the children's markup in post content, the render callback receives it as $content, and the element renders it inside its wrapper with do_shortcode() — exactly as it does for a container built in the page builder.

Section or Container?

Reach for Container when the band needs a width and a background and nothing else. Section adds shape dividers, background effects and a design variant — worth its extra options only when you use them.