A layered layout primitive inspired by SwiftUI.
ZStack layers children in the same grid area without forcing absolute positioning. It is useful for badges, status overlays, empty states, and media labels.
Children share the same grid cell by default.
Base layer
<ZStack align="center" justify="center">
<Card><CardContent><Text tone="muted">Base layer</Text></CardContent></Card>
<Badge variant="info">Overlay</Badge>
</ZStack>import { Badge, Card, ZStack } from "@froggdesign/enter-ui-react";Align and justify control where each layer sits inside the stack.
Release card
Use ZStack for simple layered UI without extra positioning wrappers.
Production package checks.
Typecheck, test, and build are tracked together.
ZStack is layout-only and does not change child semantics. Avoid duplicating meaningful content across layers, and make decorative images use empty alt text.
as: div, section, article, main, aside, nav, header, or footer.align: start, center, end, or stretch.justify: start, center, end, or stretch.fullWidth: sets width to 100%.top, right, bottom, left: external spacing (margin).padding, paddingTop, paddingRight, paddingBottom, paddingLeft: internal spacing.className.<ZStack top={8} paddingLeft={12} align="center" justify="center">
<Card>
<CardContent>
<Text tone="muted">Overlay stack</Text>
</CardContent>
</Card>
<Badge variant="info">New</Badge>
</ZStack>ZStack uses .eui-zstack and CSS Grid layering. Direct children share the same grid cell, which keeps overlays predictable without requiring custom absolute positioning for simple layer patterns.