---
title: ToolbarRole
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/toolbarrole
---

# ToolbarRole

The purpose of content that populates the toolbar.

## Declaration

```swift
struct ToolbarRole
```

## Overview

Overview A toolbar role provides a description of the purpose of content that populates the toolbar. The purpose of the content influences how a toolbar renders its content. For example, a browser will automatically leading align the title of a toolbar in iPadOS. Provide this type to the toolbarRole(_:) modifier: ContentView()     .navigationTitle("Browser")     .toolbarRole(.browser)     .toolbar {         ToolbarItem(placement: .primaryAction) {             AddButton()         }      }

## Topics

### Behavior-specific roles

- [browser](swiftui/toolbarrole/browser.md)
- [editor](swiftui/toolbarrole/editor.md)
- [navigationStack](swiftui/toolbarrole/navigationstack.md)

### Automatic roles

- [automatic](swiftui/toolbarrole/automatic.md)

## Relationships

### Conforms To

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

## See Also

### Specifying the role of toolbar content

- [toolbarRole(_:)](swiftui/view/toolbarrole(_:).md)
