primitives

Stack

Flex container with a gap that maps to the spacing scale.


Stack is a flex container whose gap resolves against the spacing scale (4px steps). The default direction is column; pair with Flex for row-by-default.

API

<Stack gap={4}>
  <Box>One</Box>
  <Box>Two</Box>
  <Box>Three</Box>
</Stack>

<Stack direction="row" gap={2} align="center" justify="between">
  <Text size="lg" weight="bold">Title</Text>
  <Button>Action</Button>
</Stack>

Props

PropTypeDefault
direction"row" | "column" | "row-reverse" | "column-reverse""column"
gapspacing key (0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24)0
align"start" | "center" | "end" | "stretch" | "baseline"-
justify"start" | "center" | "end" | "between" | "around" | "evenly"-
wrapbooleanfalse
inlineboolean (web only — renders inline-flex)false

Spacing scale

Tokenpx
00
0.52
14
1.56
28
312
416
520
624
832
1040
1248
1664
2080
2496

Native

React Native 0.71+ supports gap natively, so the native variant uses it directly. No extra divider hack needed.