Toolbars
Provide immediate access to frequently used commands and controls.
Overview
The system might present toolbars above or below your app’s content, depending on the platform and the context.
[Image]
Add items to a toolbar by applying the toolbar(content:) view modifier to a view in your app. You can also configure the toolbar using view modifiers. For example, you can set the visibility of a toolbar with the toolbar(_:for:) modifier.
For design guidance, see Toolbars in the Human Interface Guidelines.
Topics
Populating a toolbar
toolbar(content:)ToolbarItemToolbarItemGroupToolbarItemPlacementToolbarContentToolbarContentBuilderToolbarSpacerDefaultToolbarItem
Populating a customizable toolbar
toolbar(id:content:)CustomizableToolbarContentToolbarCustomizationBehaviorToolbarCustomizationOptionsSearchToolbarBehavior
Removing default items
Setting toolbar visibility
toolbar(_:for:)toolbarVisibility(_:for:)toolbarBackgroundVisibility(_:for:)ToolbarPlacementContentToolbarPlacement
Specifying the role of toolbar content
Styling a toolbar
toolbarBackground(_:for:)toolbarColorScheme(_:for:)toolbarForegroundStyle(_:for:)windowToolbarStyle(_:)WindowToolbarStyletoolbarLabelStyleToolbarLabelStyleSpacerSizing