Spacer
COMPONENT

LAYOUT / SPACER

Spacer

Flexible SwiftUI space that expands along the main axis of a VStack or HStack, pushing sibling elements neatly to opposite edges.

Signature#

SIGNATURE
<HStack>
  <Text>Left</Text>
  <Spacer minLength={8} />
  <Text>Right</Text>
</HStack>
Spacer · elastic gap
Left Spacer Right

Props#

minLengthnumberOptional
Minimum preserved gap in points even when space is tight.

Example: Horizontal & Vertical Push#

TSX
<VStack height={104} padding={12}>
  <HStack>
    <Text fontWeight="bold">Progress</Text>
    <Spacer minLength={8} />
    <Text color="theme.accent">75%</Text>
  </HStack>

  <Spacer />

  <HStack>
    <Spacer />
    <Button title="Continue"
      variant="filled" />
  </HStack>
</VStack>
Horizontal + Vertical Push
Progress 75%
Continue