Skip to main content

Function: Stack()

Stack(__namedParameters): Element

Defined in: components/Stack/Stack.tsx:93

The layout rhythm primitive — a flex container spaced from the FSL gap scale.

Entity = Structure. Use it to stack sections (direction="vertical") or lay out a row of controls (direction="horizontal") with consistent, themeable spacing. gap, align, and justify draw only from named scales/keywords — there is no raw gap: 12px, which is how spacing rhythm stays consistent across a product.

Parameters

ParameterType
__namedParametersStackProps

Returns

Element

Example

<Stack gap="lg">
<Heading level={2}>Payment</Heading>
<Stack direction="horizontal" gap="sm" justify="end">
<Button evaluation="muted">Cancel</Button>
<Button evaluation="primary">Save</Button>
</Stack>
</Stack>