React Native · Components
Stack
Lays out items in a row or column with equal gaps between them (the same names as Stack on web).
2 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
One
Two long items
Three
Code
Events
- Events appear here when you interact with the preview.
Toolbar: push to both ends
Orders
Custom separator, inline
3 min readNovember 6, 2026New
Import
Stack
componentLays out items in a row or column with equal gaps between them (the same names as Stack on web).
Examples
StackProps
interfaceProps of Stack.
Extends: ViewProps
| Name | Type | Default | Description |
|---|---|---|---|
ref? | Ref<ViewRef> | Ref of the underlying native element. | |
direction? | "row" | "column" | "column" | Direction. |
gap? | number | 0 | Gap between items, as a step on the web scale (4 = 16 px × density). |
align? | ViewStyle["alignItems"] | Alignment on the cross axis. | |
justify? | ViewStyle["justifyContent"] | Distribution on the main axis. | |
wrap? | boolean | Items that do not fit the row wrap to the next. | |
padding? | number | Padding, as a step on the web scale. | |
fill? | boolean | Fills the remaining space (flex: 1). |