One Logo Pool Ball
SwiftUI · IOS API REFERENCE

SpacerSizing

struct · iOS 26.0+ · SDK 27.1

struct SpacerSizing

A type which defines how spacers should size themselves. Use this type in coordination with the ``ToolbarSpacer`` type to define if the spacer should be a flexible size, or a fixed size using system-defined sizing rules. For example, the following adds a fixed-size toolbar spacer between the share and more buttons in the toolbar: ContentView() .toolbar(id: "main-toolbar") { ToolbarItem(id: "tag") { TagButton() } ToolbarItem(id: "share") { ShareButton() } ToolbarSpacer(.fixed) ToolbarItem(id: "more") { MoreButton() } }

Members (2)

get · iOS 26.0+

fixed

TypeScript
static get fixed(): SpacerSizing
Swift declaration
static let fixed: SpacerSizing

The fixed spacer sizing behavior. The spacer will use a pre-defined size determined by the system and the context in which the spacer is used.

get · iOS 26.0+

flexible

TypeScript
static get flexible(): SpacerSizing
Swift declaration
static let flexible: SpacerSizing

The flexible spacer sizing behavior. The spacer will expand to accommodate as much space as it is given in the current context.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →