Layout / The visual dictionary

Spacer.

A flexible empty region used to distribute remaining space.

Also calledflexible spacespring
01

See it in context

UI illustration
Brand
← Flexible space →
Action

A flexible empty region used to distribute remaining space. Let the spacer expand between elements while keeping nearby groups together.

When to use it

Use it to push toolbar actions to opposite sides or separate groups.

Know the difference

A spacer consumes layout space; padding adds space inside a specific element.

WebiOSiPadOSAndroidmacOSWindowsLinuxwatchOSWear OStvOSAndroid TVvisionOS

Web · iOS · iPadOS · Android · macOS · Windows · Linux · watchOS · Wear OS · tvOS · Android TV · visionOS

SwiftUI offers Spacer; web flex layouts can use auto margins or a growing empty region.

Primary documentation for the pattern and its platform conventions.