Stack

Overlaps children in a CSS grid stack with a configurable offset to create a card-pile effect

Category: layout · WCAG 2.2-AA · stack, pile, overlap, layered, z-axis, card-pile, layout

Props

PropTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the component.
offsetnumber4Pixel offset applied per overlapped layer in both axes. This is NOT a spacing `gap` — for gap-based vertical/horizontal layout use `Flex`/`Grid` and their `gap` prop.
classNamestringAdditional CSS class names merged onto the root element.

When to use

When not to use

How to build an accessible Stack in React →

Examples

Card pile

Three cards stacked with a 6px offset to show depth

<Stack offset={6}><Card>First</Card><Card>Second</Card><Card>Third</Card></Stack>

Tight stack

Overlapping avatar group with minimal offset

<Stack offset={2}><Avatar src="/a.jpg" /><Avatar src="/b.jpg" /><Avatar src="/c.jpg" /></Stack>

Related components

← Back to docs