Skip to content
RefineUI

Stack

One-axis flex layout with Foundation gap tokens.

Stack lays out children in a row or column with a spacing-token gap. Default direction is column.

One
Two
Three

Overview

Machine-readable contract from Component Spec.

component: stackexport: Stackversion: 1attributes: data-refineui=stack

Anatomy

Partdata-refineui
rootstack

Layout

PropertyValue
directionlogical
rtltrue
npm install @refineui/react @refineui/tokens
import { Button, Stack } from "@refineui/react";
<Stack gap="sizeMedium">
<div>Item 1</div>
<div>Item 2</div>
</Stack>
<Stack direction="row" gap="sizeSmall" align="center" justify="between">
<Button type="button" variant="outline">Cancel</Button>
<Button type="button" variant="primary">Save</Button>
</Stack>
PropDefaultTypeDescription
as"div"ElementTypeRoot element.
direction"column""row" | "column" | "row-reverse" | "column-reverse"Flex direction.
gap"sizeNone"Spacing tokenGap between children.
align"start" | "center" | "end" | "stretch" | "baseline"Cross-axis alignment.
justify"start" | "center" | "end" | "between" | "around" | "evenly"Main-axis justification.
wrapboolean | wrap tokenWrapping behavior.
inlinefalsebooleanUse `inline-flex`.