Stack
Lays its children out in a row or a column with spacing from the scale. Use it for every one-dimensional layout in app code, instead of a styled div.
React
Ready
Figma
React examples
Rows inside a column
Hawk 2Online
A column of three rows, 12px apart. The first and last rows are rows of their own.import { Badge, Button, Stack, Text } from "@kela-systems/ui-components"; export default function StackDefault() { return ( <Stack gap={3} className="w-full max-w-sm"> <Stack direction="row" justify="between" align="center"> <Text variant="body-md-medium">Hawk 2</Text> <Badge variant="success">Online</Badge> </Stack> <Text variant="body-sm-regular" tone="neutral-secondary"> A column of three rows, 12px apart. The first and last rows are rows of their own. </Text> <Stack direction="row" gap={2} justify="end"> <Button variant="outline" size="sm"> Cancel </Button> <Button size="sm">Launch</Button> </Stack> </Stack> ); }
Props
Stack
| Name | Default | Description |
|---|---|---|
direction"row" | "column" | "column" | |
align"center" | "start" | "end" | "stretch" | "baseline" | ||
justify"center" | "start" | "end" | "between" | ||
gapSpacingStep | "auto" | ||
wrapboolean | false | |
inlineboolean | false | |
growboolean | false | |
shrinkboolean | true | |
clipboolean | false | |
paddingSpacingStep | ||
paddingInlineSpacingStep | ||
paddingBlockSpacingStep | ||
paddingInlineStartSpacingStep | ||
paddingInlineEndSpacingStep | ||
paddingBlockStartSpacingStep | ||
paddingBlockEndSpacingStep |
It also takes the attributes of the HTML element it renders.
Related
Weigh Stack against these before you choose.