Command palette

@yasinsensoy/native

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

import { Stack } from "@yasinsensoy/native";

<Stack direction={{ base: "column", md: "row" }}>
  …
</Stack>

Events

  1. Events appear here when you interact with the preview.

Toolbar: push to both ends

Orders

Custom separator, inline

3 min readNovember 6, 2026New

Import

import { Stack } from "@yasinsensoy/native";

Stack

component

Lays out items in a row or column with equal gaps between them (the same names as Stack on web).

Stack({ ref, direction, gap, align, justify, wrap, padding, fill, style, ...props }: StackProps): JSX.Element

Examples

`<Stack direction="row" gap={2} align="center">…</Stack>`

StackProps

interface

Props of Stack.

Extends: ViewProps

NameTypeDefaultDescription
ref?Ref<ViewRef>Ref of the underlying native element.
direction?"row" | "column""column"Direction.
gap?number0Gap 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?booleanItems that do not fit the row wrap to the next.
padding?numberPadding, as a step on the web scale.
fill?booleanFills the remaining space (flex: 1).