Skip to main content

Arrange a screen

Arrange two boxes side by side below a label.

Before you start: Your first screen.

Column stacks children vertically. Row places them horizontally. View is a box. A literal class lists utilities separated by spaces. Here w-12 and h-12 give each box a size; gap-2 separates them.

Two boxes in a row​

The inner row is one child of the outer column. Numeric spacing uses four logical units per step: gap-2 is 8 units.

<Column class="p-4 gap-3">
<Text text="A column stacks its children" />
<Row class="gap-2">
<View class="w-12 h-12 bg-accent" />
<View class="w-12 h-12 bg-muted" />
</Row>
</Column>
Rows and columns
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

Try it: Change the row to Column, then change gap-2 to gap-4. Observe direction and spacing separately.

Next: style a screen. For scrolling and finite bounds, use the later layout guide.