Skip to main content

ZStack

A view that overlays its children, aligning them in both axes

Example​

<ZStack frame={{ width: 100, height: 100 }}>
<Image systemName="circle.fill" fontSize={100} />
<Image systemName="circle.fill" foregroundColor="systemTeal" fontSize={50} />
<Text foregroundColor="white" bold>
ZStack
</Text>
</ZStack>

Props​

ZStack inherits all View Modifiers as props.

propdescriptiontyperequireddefault
spacingAmount of space between stack itemsnumberno0
alignmentThe alignment guide'leading' | 'trailing'| 'top' | 'bottom' | 'topLeading' | 'topTrailing' | 'bottomLeading' | 'bottomTrailing' | 'center'no'center'
childrenStack itemsReactNodenonull