---
title: ToolbarSpacer
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/toolbarspacer
---

# ToolbarSpacer

A standard space item in toolbars.

## Declaration

```swift
nonisolated struct ToolbarSpacer
```

## Overview

Overview A space item creates visual breaks in the toolbar between items. Spacers can have a standard fixed size or be flexible and push items apart. Spacers can also be used in customizable toolbars: ContentView()     .toolbar(id: "main-toolbar") {         ToolbarItem(id: "tag") {            TagButton()         }         ToolbarItem(id: "share") {            ShareButton()         }         ToolbarSpacer(.fixed)         ToolbarItem(id: "more") {            MoreButton()         }     } Space items are customizable and can be added, removed, and rearranged by users. If a customizable toolbar supports a spacer of a given type, users can also add in multiple copies of that spacer from the customization panel.

## Topics

### Initializers

- [init(_:placement:)](swiftui/toolbarspacer/init(_:placement:).md)

## Relationships

### Conforms To

- [CustomizableToolbarContent](swiftui/customizabletoolbarcontent.md)
- [ToolbarContent](swiftui/toolbarcontent.md)

## See Also

### Populating a toolbar

- [toolbar(content:)](swiftui/view/toolbar(content:).md)
- [ToolbarItem](swiftui/toolbaritem.md)
- [ToolbarItemGroup](swiftui/toolbaritemgroup.md)
- [ToolbarItemPlacement](swiftui/toolbaritemplacement.md)
- [toolbarOverflowMenu(content:)](swiftui/view/toolbaroverflowmenu(content:).md)
- [ToolbarOverflowMenu](swiftui/toolbaroverflowmenu.md)
- [ToolbarContent](swiftui/toolbarcontent.md)
- [ToolbarContentBuilder](swiftui/toolbarcontentbuilder.md)
- [DefaultToolbarItem](swiftui/defaulttoolbaritem.md)
