Unify Logo Footer.svg
Unify Applications
Logo
Container & Stack

Container & Stack

Logo

7 mins READ

Container Block

The Container block is the fundamental structure block: a box that arranges child blocks into one of 15 column layouts — full width, equal columns (2–6 columns), or ratio splits like 1_2 and 2_1_1. It has no data, events, or methods of its own; it purely structures a page, controls spacing and borders, and shows or hides whole sections at once.

Note: Use Container when you need fixed column ratios — for example a sidebar + content split with 1_3 layout. Use Stack when you need flexible flex-based alignment along a single axis.

Column Layouts

The variant property controls the column layout. Numbers describe width ratios: 1_2 is one-third / two-thirds. Equal-width layouts are labeled by column count.

Layout LabelVariant ValueDescription
Full"1"Single full-width column; children stack as full-width rows
1:1 (2 columns)"1_1"Two equal columns
1:2"1_2"One-third left, two-thirds right
1:3"1_3"Quarter left, three-quarters right
2:1"2_1"Two-thirds left, one-third right
2:3"2_3"Two-fifths left, three-fifths right
3:1"3_1"Three-quarters left, quarter right
3:2"3_2"Three-fifths left, two-fifths right
1:1:2"1_1_2"Quarter / quarter / half
1:2:1"1_2_1"Quarter / half / quarter
2:1:1"2_1_1"Half / quarter / quarter
3 columns"1_1_1"Three equal columns (default for new blocks)
4 columns"1_1_1_1"Four equal columns
5 columns"1_1_1_1_1"Five equal columns
6 columns"1_1_1_1_1_1"Six equal columns

Container Properties

PropertyTypeRequiredWhere to SetDescription
variantstring (layout key)OptionalInspector → Appearance → LayoutColumn layout ratio. Default: 1_1_1 (3 equal columns)
visibilityconditionsOptionalInspector → Appearance → VisibilityShow/hide the container and all its children based on conditions
stylesstyle objectOptionalInspector → Appearance → StylesHeight (min/max), margin, padding, column gap, stroke, border-radius, and more
themeinherit | light | darkOptionalInspector → Appearance → ThemeForce a light or dark theme for all child blocks, or inherit app theme. Default: inherit
permissionspermission ruleOptionalInspector → Appearance → PermissionsRestrict who can see the container and all its children
htmlAttributesHTML attributesOptionalInspector → Appearance → HTML AttributesEscape hatch for raw HTML attributes on the container element
customCSSCSS stringOptionalInspector → Appearance → Custom CSSCustom CSS applied to the container element

Container Behaviors & Gotchas

Warning: Extra children wrap to a new row: A column layout doesn't cap how many blocks you can drop in. Children fill columns left-to-right, and once a row is full the next child starts a new row with the same column widths. Five blocks in a 1_1 layout render as two full rows plus a third row with one block.

Note: Full layout has no columns: The Full variant stacks children as full-width rows — gap still applies between them, but column behavior only exists in multi-column layouts.

Note: Mobile apps get a different style set: Some web-only style options (like page-break control) are not offered in mobile apps, and the container uses native layout rendering.

Container — Examples & Patterns

Stack Block

The Stack is the primary flexible layout block: a flex container that lines up child blocks along a single axis — a horizontal Row or vertical Column — with control over gap, cross-axis alignment, main-axis distribution, wrapping, overflow scrolling, and a light/dark theme override. Stack renders on both web and native mobile.

Note: Default to Stack as your go-to layout container. Use Container only when you specifically need fixed column-ratio splits.

Stack Properties

PropertyTypeDefaultWhere to SetDescription
direction"column" | "row"columnInspector → Appearance → DirectionMain axis. Column stacks top-to-bottom; Row lays out left-to-right
distribute (justifyContent)flex-start | center | flex-end | space-betweenflex-startInspector → Appearance → DistributeHow children are spaced along the main axis
align (alignItems)flex-start | center | flex-end | stretchstretch (web), flex-start (mobile)Inspector → Appearance → AlignHow children line up on the cross axis
wrapContentbooleanfalseInspector → Appearance → Wrap ContentWhen on, children overflow onto a new line instead of shrinking
reverseOrderbooleanfalseInspector → Appearance → Reverse OrderRenders children in reverse. Row becomes right-to-left; Column becomes bottom-to-top
stylesstyle objectgap-md, transparent bgInspector → Appearance → StylesWidth, height, margin, padding, gap, overflow, background, shadow, border stroke/radius, rotation
themeinherit | light | darkinheritInspector → Appearance → ThemeForce light or dark theme for all children, or inherit
visibilityconditionsalways visibleInspector → Appearance → VisibilityShow/hide the stack and all children
permissionspermission rulesno restrictionInspector → Appearance → PermissionsRole or rule-based access controlling who sees the Stack
interactionsevent handlersnoneInspector → Appearance → InteractionsAttach On Click, On Mouse Enter, or On Long Press event handlers
effects (mobile only)list of effect layersnoneInspector → Appearance → EffectsDrop shadow, inner shadow, layer blur, background blur. Mobile apps only

Stack Events

EventTriggerAvailable When
On ClickUser taps or clicks the StackAn On Click interaction is added; works on all platforms
On Mouse EnterPointer moves over the StackWeb app, desktop device variant only
On Long PressUser presses and holdsMobile or tablet device variant only

Stack Behaviors & Gotchas

Warning: Effects override legacy shadow/blur styles: If you set both a shadow in Styles and a drop shadow in Effects, the Effect wins — it layers on top of framing styles.

Warning: Adding or removing the first effect remounts the Stack: Switching between zero effects and one effect remounts the block, resetting any transient visual state in the subtree. This only happens at the empty-to-first and last-to-empty boundary.

Note: Scrolling behavior differs on mobile: Setting Overflow to scroll on web is plain CSS. On native, the Stack wraps children in a real scroll view (vertical or horizontal). A native Stack only scrolls when the overflow value is explicitly set.

Note: Reverse Order + Direction combine: Direction offers only Row and Column. Enabling Reverse Order produces row-reverse or column-reverse — the two settings combine.

Note: Layout properties can be bound to variables: Direction, Align, Distribute, Wrap, Reverse Order, Theme, and Styles values can all be driven by variables and update live at runtime.

Stack — Examples & Patterns

Container vs. Stack — At a Glance

FeatureContainerStack
Layout modelFixed column-ratio gridFlexbox (single axis)
Column ratios15 presets (e.g., 1:2, 2:1:1)Not applicable
Direction controlNot applicableRow or Column
Alignment controlsNot applicableDistribute + Align
Wrap contentChildren always wrap to new rowsOpt-in via Wrap Content toggle
ScrollingVia child blocksVia Overflow style setting
EventsNone (layout only)On Click, On Mouse Enter, On Long Press
Mobile effectsNoYes (drop shadow, blur, etc.)
Theme overrideYesYes
Visibility conditionsYesYes
BlockRelationship
CardA Stack-like container with a built-in header, border, and collapse behavior
ScrollableA dedicated scroll region with scroll-specific methods and events
RepeatableRepeats its children once per data row; Container/Stack lay children out once
DrawerUses Container/Stack as its slot children; overlays the page

Frequently Asked Questions

When should I use a Container instead of a Stack?

Use Container when you need fixed column-ratio layouts — for example a 1/3 sidebar next to a 2/3 content area. Use Stack when you need flexible flexbox alignment along a single axis (row or column), with controls over alignment, distribution, wrapping, and scrolling.

Can I nest a Stack inside a Container column?

Yes. Each column in a Container can hold any block, including a Stack. This is the typical pattern: a Container sets the column widths, and Stacks inside each column arrange their own children with flexbox control.

How do I make a Stack scroll vertically?

In the Stack's Styles panel, set Overflow to a vertical scroll value and give the Stack a fixed Max Height. Content beyond that height will scroll. On native mobile apps, this automatically creates a real scroll view.

Why did my Stack contents overflow instead of wrapping?

Wrap Content is off by default. Enable it in Inspector → Appearance → Wrap Content so children wrap to a new line when the available width runs out instead of shrinking or overflowing.

Can I conditionally show or hide a Container and all its child blocks at once?

Yes. Set a Visibility condition on the Container itself (Inspector → Appearance → Visibility). When the condition evaluates to false, the Container and all blocks inside it are hidden as one unit — you don't need to set visibility on each child individually.