Skip to content
MyAppBuilder
StableGuide

Direction and stacking

Containers decide how their children are arranged: in a grid, in a row or column, or simply stacked. On small screens you often want items that sit side by side on desktop to stack on top of each other, or to appear in a different order. This page explains the three arrangements

Containers decide how their children are arranged: in a grid, in a row or column, or simply stacked. On small screens you often want items that sit side by side on desktop to stack on top of each other, or to appear in a different order. This page explains the three arrangements and the controls that change them per device.

When to use

  • A row of buttons or filters that should become a vertical list on phones.
  • A sidebar-plus-content layout that should become content-first on mobile.
  • Putting the most important card first on mobile even if it is third on desktop.

The three arrangements

Select a container (Container, Section, Card, Row…) and open Layout › Children › Arrange:

ArrangeBehaviour
GridChildren take column spans on a 12-column grid (or equal cells). This is the default and the most predictable on every screen size.
Row / columnChildren flow in one direction. Choose Row → or Column ↓, set Align and Justify, and optionally Wrap.
StackChildren are placed one under the other with the gap between them.

The Gap (px) field controls the space between children; leave it empty to use the theme's spacing.

Stacking a row on mobile

  1. Select the row container.
  2. In Layout › Children, set Arrange to Row / column and Direction to Row →.
  3. Tick Wrap (stack on mobile). On mobile the row becomes a column and children stretch to full width. On desktop and tablet, items wrap to a new line only when they run out of space.
Example
Desktop row (wrap on)                 Mobile
[ Search ][ Status ][ Add customer ]  [ Search               ]
                                      [ Status               ]
                                      [ Add customer         ]

Changing the direction on one device

For a container, the Responsive tab offers Direction (Row / Column) and Alignment per breakpoint. For example, keep "Row" on desktop and set "Column" on mobile without using wrap.

Reordering per device

Every component has an Order field (Layout tab, and per breakpoint in the Responsive tab). Lower numbers come first; the default is 0. Order lets you move the most important item to the top on mobile while keeping the desktop arrangement:

Example
Desktop (order 0, 0, 0)         Mobile (Summary card: order -1)
[ Filters ][ List ][ Summary ]  [ Summary ]
                                [ Filters ]
                                [ List    ]

Order values range from -100 to 100.

Common mistakes

  • Using Row without Wrap for many items. On a phone the row keeps everything on one line and the items shrink or overflow. Turn on Wrap or switch Direction to Column on mobile.
  • Reordering with drag and drop to fix mobile. Dragging on the canvas changes the real order for every device. Use the Order field in the Responsive tab for a mobile-only change.
  • Expecting Align to work in Grid. Align and Justify only apply to the Row / column arrangement.

Advanced

The arrangement is stored in the container's layout.display (grid, flex, block) with direction, align, justify, wrap and gap. Wrap on a row adds the mab-stack-mobile class, which switches to flex-direction: column under 640 px. Order is written to --order-d/-t/-m CSS variables; a breakpoint without its own value inherits from the larger one (mobile falls back to tablet, then desktop).

Related

Was this helpful?