Skip to main content

Flex and alignment

Supported flex and alignment utilities.

Quick reference​

SyntaxBehavior
flex-row / flex-colHorizontal/vertical flow; reverse forms supported.
flex-wrap / flex-nowrap / flex-wrap-reverseWrap policy.
flex-1 / flex-auto / flex-initial / flex-noneFlex allocation.
grow / grow-0 / shrink / shrink-0Growth and shrinking.
basis-N / basis-1/2Initial allocation.
items-start / center / end / stretchCross-axis alignment, with the items- prefix.
justify-start / center / end / between / around / evenlyMain-axis alignment, with the justify- prefix.
self-auto / start / center / end / stretchChild alignment, with the self- prefix.
content-start / center / end / between / around / evenly / stretchWrapped-line alignment, with the content- prefix.

Example​

<Row class="gap-2 items-center"><Text text="Label" /><View class="flex-1 h-8 bg-accent" /></Row>

Rules and validation​

Row and Column establish flow; container alignment/gaps require supported containers. Flex growth needs finite parent constraints. Control-state variants cannot change layout.

Style lesson · Style index · Themes