Skip to content

Row & Column

Row and Column are directional auto-layout containers. A Row arranges children left-to-right; a Column arranges them top-to-bottom. They’re the most common layouts you’ll use.

The Child Layout inspector section for a Row/Column container.

The mental model

Each container has a main axis and a cross axis:

ContainerMain axisCross axis
RowHorizontalVertical
ColumnVerticalHorizontal

Children flow along the main axis with Gap between them, then position on the cross axis according to CrossAlign. Extra main-axis space is distributed by the Gap unit (SpaceBetween / SpaceAround / SpaceEvenly).

Basic Row

Row layout

Row layout

A Row arranges children left-to-right. An element with Width = Fill and no other content is the canonical spacer — insert it between siblings to push them apart.

Set Layout Type to Row.

Basic Column

Column layout

Column layout

A Column stacks children top-to-bottom. Three vertically stacked sections — header (Hug height), body (Fill), footer (Hug) — where the body absorbs all extra vertical space.

Set Layout Type to Column.

Alignment

MainAlign and CrossAlign set how the whole content block sits within the container.

PropertyValuesEffect
MainAlignStart · Center · EndPosition of the children block along the main axis
CrossAlignStart · Center · End · StretchPosition along the cross axis; Stretch grows children to fill the cross axis
Alignment

Alignment

MainAlign and CrossAlign set how the whole content block sits within the container. Center() is shorthand for .MainAlign(Center).CrossAlign(Center).

Set the main and cross Alignment (e.g. center).

Main-axis distribution

When children don’t fill the main axis, distribution decides how the leftover space is spread between them. There’s no separate field — it lives in the Gap unit (or the builder’s SpaceBetween() / SpaceAround() / SpaceEvenly()).

Gap unitBuilder / valueEffectPicture
px (default).Gap(n)Children packed, gap = the literal value[A][B][C]_____
autoUIGap.SpaceBetweenEqual gaps between children, none at edges[A]___[B]___[C]
aroundUIGap.SpaceAroundEqual gaps, half-gaps at the edges_[A]__[B]__[C]_
evenUIGap.SpaceEvenlyEqual gaps everywhere, including the edges__[A]__[B]__[C]__

The Gap demo below steps through fixed pixel gaps and all three distribution modes in one clip.

When the Gap unit is a distribution mode (anything other than pixels/percent), MainAlign is effectively ignored — distribution decides where children sit.

Wrap

Set .Wrap() on a Row or Column to let children flow onto new lines when they overflow the main axis.

Wrap

Wrap

Set Wrap on a Row or Column to let children flow onto new lines when they overflow the main axis. WrapGap sets the cross-axis gap between wrap lines.

Enable Wrap.

A wrapped Column flows children top-to-bottom, then wraps into new columns. (Less common but supported.)

Reverse children

Flip the visual order of children without changing alignment semantics. Row + ReverseChildren = right-to-left iteration; Alignment.Start still means “the start of the main axis” (the left edge).

Reverse children

Reverse children

Flip the visual order of children without changing alignment semantics. Row + ReverseChildren = right-to-left iteration, but Alignment.Start still means the start of the main axis.

Enable Reverse Children.

Orthogonal to Direction — the two can be combined.

Direction

Direction(LayoutDirection.RightToLeft) (or shorthand .RTL()) flips Row/Wrap visually right-to-left, AND remaps Alignment.Start to the right edge. This is the correct way to support Arabic/Hebrew layouts. Inherits down the tree.

Direction / RTL

Direction / RTL

Direction(LayoutDirection.RightToLeft) (shorthand .RTL()) flips Row/Wrap visually right-to-left and remaps Alignment.Start to the right edge — the correct way to support Arabic/Hebrew layouts. Inherits down the tree.

Set Direction to RTL.

Values: Inherit (default — uses parent’s direction) · LeftToRight · RightToLeft. Has no effect on Column.

Gap

The space between adjacent children. Has no effect on Grid — use Grid → Column Gap and Row Gap instead.

Gap & distribution

Gap & distribution

The Gap field, both ways: a fixed pixel gap growing (0, 40, 120), then the distribution modes (Space-between / Space-around / Space-evenly) that spread children using free space. Percentage variant .GapPercent(2) is 2% of the parent's main-axis size.

Set Gap to 8 for a fixed gap — or change the unit to auto (SpaceBetween) / around (SpaceAround) / even (SpaceEvenly) for a distribution mode.

Percentage variant: .GapPercent(2) is “2% of parent’s main-axis size.”

The Gap inspector field accepts unit suffixes, math, and auto/even distribution shorthands — type auto for SpaceBetween, around for SpaceAround, even for SpaceEvenly. See Inspector Input.

Wrap Gap

The cross-axis spacing between wrap lines. Only appears in the inspector when Wrap is enabled. Gap sets the spacing between cards on a line; Wrap Gap sets the spacing between the wrapped lines.

WrapGap(-1) (the default) means “use the same value as Gap.”

Linear item

Cross-axis alignment for a single child can override the parent’s CrossAlign — set on the child, not the Row/Column container.

Linear item

Linear item

Cross-axis alignment for a single child can override the parent's CrossAlign — set on the child, not the Row/Column container.

On the child’s Linear Item, set Cross Align Override.

CrossAxisSelfAlign takes a CrossAxisItemAlign:

ValueEffect
Inherit (default)Use the parent’s CrossAlign
StartPin to the cross-axis start (top in Row, left in Column)
CenterCenter on the cross axis
EndPin to the cross-axis end

There is intentionally no Stretch value — to stretch a single child across the parent’s cross axis, set its cross-axis size to Fill or Percentage instead.

Common patterns

Toolbar (left + right)

A Row container with Width Fill, holding the brand element, then a Fill-width spacer child that pushes the trailing buttons to the right edge. See the Code API for the builder version.

A Column container filling both axes, with a Hug-height header, a Fill-height body that absorbs the extra vertical space, and a Hug-height footer. See the Code API for the builder version.

Card grid (wrapped row of cards)

A Row container with Width Fill and Wrap enabled, holding fixed-width Hug-height card children that flow onto new lines as they overflow. See the Code API for the builder version.

For dense, performant grids of many items, prefer the GridView virtualised component.

  • Sizing — Fill/Hug behaviour in Row & Column
  • Padding · Margin — spacing knobs
  • Grid — for true 2D grids instead of wrapping rows
  • AutoUI — builder reference
Docs for AutoLayout PRO v1.0.0 Changelog