---
title: SpacerSizing
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/spacersizing
---

# SpacerSizing

A type which defines how spacers should size themselves.

## Declaration

```swift
struct SpacerSizing
```

## Overview

Overview 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()         }     }

## Topics

### Type Properties

- [fixed](swiftui/spacersizing/fixed.md)
- [flexible](swiftui/spacersizing/flexible.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Styling a toolbar

- [toolbarBackground(_:for:)](swiftui/view/toolbarbackground(_:for:).md)
- [toolbarColorScheme(_:for:)](swiftui/view/toolbarcolorscheme(_:for:).md)
- [toolbarForegroundStyle(_:for:)](swiftui/view/toolbarforegroundstyle(_:for:).md)
- [windowToolbarStyle(_:)](swiftui/scene/windowtoolbarstyle(_:).md)
- [WindowToolbarStyle](swiftui/windowtoolbarstyle.md)
- [toolbarLabelStyle](swiftui/environmentvalues/toolbarlabelstyle.md)
- [ToolbarLabelStyle](swiftui/toolbarlabelstyle.md)
