---
title: "visibilityPriority(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/customizabletoolbarcontent/visibilitypriority(_:)"
---

# visibilityPriority(_:)

Defines the visibility priority for a toolbar item.

## Declaration

```swift
func visibilityPriority(_ priority: ToolbarItemVisibilityPriority) -> some CustomizableToolbarContent

```

## Parameters

- `priority`: The visibility priority for this toolbar item.

## Discussion

Discussion When toolbar space is limited, items with a lower priority move into the overflow menu before items with a higher priority. The default is automatic. In the following example, PrimaryControl stays visible in the toolbar longer than SecondaryControl: struct RootView: View {     var body: some View {         ContentView()             .toolbar {                 ToolbarItem {                     SecondaryControl()                 }                 ToolbarItem {                     PrimaryControl()                 }                 .visibilityPriority(.high)             }     } }
