---
title: "contentToolbar(for:content:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/contenttoolbar(for:content:)"
---

# contentToolbar(for:content:)

Populates the toolbar of the specified content view type with the views you provide.

## Declaration

```swift
nonisolated func contentToolbar<Content>(for placement: ContentToolbarPlacement, @ContentBuilder content: () -> Content) -> some View where Content : View

```

## Parameters

- `content`: The views representing the content of the toolbar.

## Discussion

Discussion Use this modifier to add toolbar content that remains consistent regardless of the content view. Unlike the toolbar modifier, which configures the toolbar of the modified view’s container, the contentToolbar modifier configures the toolbar within the modified view’s content instead. This means that the contentToolbar modifier should generally be applied directly to a container view, instead of to the content within a container view. For example, to configure the toolbar of tab view’s sidebar, apply the contentToolbar modifier to the TabView itself, not to any of the tabs within the TabView. The example below adds a button to the tab view sidebar. TabView {     Tab("Home", systemImage: "house") {         HomeView()     }

Tab("Alerts", systemImage: "bell") {         AlertsView()     }

TabSection("Categories") {         Tab("Climate", systemImage: "fan") {             ClimateView()         }

Tab("Lights", systemImage: "lightbulb") {             LightsView()         }     } } .tabViewStyle(.sidebarAdaptable) .contentToolbar(for: .tabViewSidebar) {     DisconnectDevicesButton() }

## See Also

### Toolbars

- [toolbar(content:)](swiftui/view/toolbar(content:).md)
- [toolbar(id:content:)](swiftui/view/toolbar(id:content:).md)
- [toolbar(_:for:)](swiftui/view/toolbar(_:for:).md)
- [toolbar(removing:)](swiftui/view/toolbar(removing:).md)
- [toolbarVisibility(_:for:)](swiftui/view/toolbarvisibility(_:for:).md)
- [toolbarBackground(_:for:)](swiftui/view/toolbarbackground(_:for:).md)
- [toolbarBackgroundVisibility(_:for:)](swiftui/view/toolbarbackgroundvisibility(_:for:).md)
- [toolbarItemHidden(_:)](swiftui/view/toolbaritemhidden(_:).md)
- [toolbarForegroundStyle(_:for:)](swiftui/view/toolbarforegroundstyle(_:for:).md)
- [toolbarColorScheme(_:for:)](swiftui/view/toolbarcolorscheme(_:for:).md)
- [toolbarOverflowMenu(content:)](swiftui/view/toolbaroverflowmenu(content:).md)
- [toolbarRole(_:)](swiftui/view/toolbarrole(_:).md)
- [toolbarMinimizationSafeAreaAdjustment(_:for:)](swiftui/view/toolbarminimizationsafeareaadjustment(_:for:).md)
- [toolbarMinimizeBehavior(_:for:)](swiftui/view/toolbarminimizebehavior(_:for:).md)
- [toolbarTitleMenu(content:)](swiftui/view/toolbartitlemenu(content:).md)
