<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/CustomizableToolbarContent/sharedBackgroundVisibility(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI26CustomizableToolbarContentPAAE26sharedBackgroundVisibilityyQrAA0H0OF"
  },
  "title" : "sharedBackgroundVisibility(_:)"
}
-->

# sharedBackgroundVisibility(_:)

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.

```
nonisolated func sharedBackgroundVisibility(_ visibility: Visibility) -> some CustomizableToolbarContent
```

## Parameters

`visibility`

The visibility of the background effect.

## Discussion

This modifier adjusts the visibility of that effect. Hiding the
effect will cause the item to be placed in its own grouping.

```
ContentView()
    .toolbar(id: "main") {
        ToolbarItem(id: "build-status", placement: principal) {
            BuildStatus()
        }
        .sharedBackgroundVisibility(.hidden)
    }
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)