Interactive previews iPhone
ToolbarSpacer
A standard space item in toolbars
Platform Compatibility
iOS 26.0+ iPadOS 26.0+ macOS 26.0+
Tags
SwiftUI Code
content
.toolbar {
ToolbarItemGroup(placement: .primaryAction) {
Button("Up", systemImage: "chevron.up", action: action)
Button("Down", systemImage: "chevron.down", action: action)
}
ToolbarSpacer(.fixed, placement: .primaryAction)
ToolbarItem(placement: .primaryAction) {
Button("Settings", systemImage: "ellipsis", action: action)
}
}Found an issue or have a suggestion?
Created: June 10, 2025Updated: December 27, 2025
More Toolbars Components
View allPrefer Vertical Toolbar Items
A compression behavior that prioritizes keeping toolbar items visible over other elements, such as tabs. By default, tabs are prioritized.
Toolbar Overflow Menu
The overflow menu of a toolbar. An overflow menu represents actions that are always placed in the toolbar’s overflow menu, regardless of the toolbar mode, platform, or customizability.
Pinned Toolbar Item Placement
A placement that pins the item to the trailing edge of the toolbar.
ToolbarItem Shared Background Visibility
Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping