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

ToolbarItem Shared Background Visibility - iOS Light Mode Preview

Platform Compatibility

iOS 26.0+ iPadOS 26.0+ macOS 26.0+

Tags

SwiftUI Code

Docs
NavigationStack {
  Text("Foo")
    .toolbar {
    ToolbarItem {
      Button("Account", systemImage: "person.circle", action: action)
    }
    ToolbarItem {
      Button("Account", systemImage: "person.circle", action: action)
    }
    .sharedBackgroundVisibility(.hidden)
  }
}

Found an issue or have a suggestion?

Created: June 10, 2025Updated: June 10, 2025