---
title: "ToolbarItem Shared Background Visibility | Explore SwiftUI"
description: "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"
canonical_url: "https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility"
meta:
  author: "Explore SwiftUI"
  "og:description": "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"
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_ToolbarItem%2BShared%2BBackground%2BVisibility%2Cdescription_~Q29udHJvbHMgdGhlIHZpc2liaWxpdHkgb2YgdGhlIGdsYXNzIGJhY2tncm91bmQgZWZmZWN0IG9uIGl0ZW1zIGluIHRoZSB0b29sYmFyLiBJbiBjZXJ0YWluIGNvbnRleHRzLCBzdWNoIGFzIHRoZSBuYXZpZ2F0aW9uIGJhciBvbiBpT1MgYW5kIHRoZSB3aW5kb3cgdG9vbGJhciBvbiBtYWNPUywgdG9vbGJhciBpdGVtcyB3aWxsIGJlIGdpdmVuIGEgZ2xhc3MgYmFja2dyb3VuZCBlZmZlY3QgdGhhdCBpcyBzaGFyZWQgd2l0aCBvdGhlciBpdGVtcyBpbiB0aGUgc2FtZSBsb2dpY2FsIGdyb3VwaW5n%2Ccategory_Toolbars%2Cimage_~L2FwaS9pbWFnZXMvOTIvdmFyaWFudHMvMjk1P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_top%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm90dG9tOiAwOyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLXRvcC1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiXX0%2Cp_Ii9saWJyYXJ5L3Rvb2xiYXJzL3Rvb2xiYXJpdGVtLXNoYXJlZC1iYWNrZ3JvdW5kLXZpc2liaWxpdHki%2Cs_HYD2haP4Ei321vx-.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "ToolbarItem Shared Background Visibility | Explore SwiftUI"
  "twitter:description": "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"
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_ToolbarItem%2BShared%2BBackground%2BVisibility%2Cdescription_~Q29udHJvbHMgdGhlIHZpc2liaWxpdHkgb2YgdGhlIGdsYXNzIGJhY2tncm91bmQgZWZmZWN0IG9uIGl0ZW1zIGluIHRoZSB0b29sYmFyLiBJbiBjZXJ0YWluIGNvbnRleHRzLCBzdWNoIGFzIHRoZSBuYXZpZ2F0aW9uIGJhciBvbiBpT1MgYW5kIHRoZSB3aW5kb3cgdG9vbGJhciBvbiBtYWNPUywgdG9vbGJhciBpdGVtcyB3aWxsIGJlIGdpdmVuIGEgZ2xhc3MgYmFja2dyb3VuZCBlZmZlY3QgdGhhdCBpcyBzaGFyZWQgd2l0aCBvdGhlciBpdGVtcyBpbiB0aGUgc2FtZSBsb2dpY2FsIGdyb3VwaW5n%2Ccategory_Toolbars%2Cimage_~L2FwaS9pbWFnZXMvOTIvdmFyaWFudHMvMjk1P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_top%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm90dG9tOiAwOyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLXRvcC1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiXX0%2Cp_Ii9saWJyYXJ5L3Rvb2xiYXJzL3Rvb2xiYXJpdGVtLXNoYXJlZC1iYWNrZ3JvdW5kLXZpc2liaWxpdHki%2Cs_HYD2haP4Ei321vx-.png"
  "twitter:title": "ToolbarItem Shared Background Visibility | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=92)

# **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 on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/92/variants/295?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 26.0+ iPadOS 26.0+ macOS 26.0+

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/toolbarcontent/sharedbackgroundvisibility(_:)>)

```
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: December 27, 2025

![Connect Wizard](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

### **More Toolbars Components **

[**View all **](https://exploreswiftui.com/library/toolbars)

![Prefer Vertical Toolbar Items - iOS on iPhone Duo - Landscape - Closed - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/248/variants/1749?v=1790419867105&r=2&w=412&q=75&f=webp)

### **Prefer Vertical Toolbar Items**

A compression behavior that prioritizes keeping toolbar items visible over other elements, such as tabs. By default, tabs are prioritized.

![Axis Behavior - iOS on iPhone Duo - Landscape - Closed - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/247/variants/1692?v=1790586402346&r=2&w=412&q=75&f=webp)

### **Axis Behavior**

The bar axis behavior of the toolbar item.

![Toolbar Item Visibility Priority - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/238/variants/733?v=1792389091475&r=2&w=412&q=75&f=webp)

### **Toolbar Item Visibility Priority**

Defines the visibility priority for a toolbar item.

![Toolbar Overflow Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/237/variants/731?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Toolbar Overflow Menu**

The overflow menu of a toolbar. An overflow menu represents actions that are always placed in the toolbar’s overflow menu, regardless of the toolbar mode, platform, or customizability.

![Pinned Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/236/variants/527?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Pinned Toolbar Item Placement**

A placement that pins the item to the trailing edge of the toolbar.

![Remove Toolbar Item Margin - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/235/variants/665?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Remove Toolbar Item Margin**

Configures whether the content margins are removed.

![Title Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/95/variants/279?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Title Toolbar Item Placement**

Places content in the title area

![ToolbarSpacer - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/82/variants/106?v=1790073478842&r=2&w=412&q=75&f=webp)

### **ToolbarSpacer**

A standard space item in toolbars

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![MenuControlGroupStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/55/variants/99?v=1790073478842&r=2&w=412&q=75&f=webp)

### **MenuControlGroupStyle**

A control group style that presents its content as a menu when the user presses the control, or as a submenu when nested within a larger menu

![Glass Button Styles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/87/variants/314?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Glass Button Styles**

A button style that applies glass border artwork based on the button’s context

![HelpLink - macOS - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/77/variants/30?v=1790073478842&r=2&w=412&q=75&f=webp)

### **HelpLink**

A button with a standard appearance that opens app-specific help documentation

![Preferred Top Column - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/256/variants/1967?v=1791379474964&r=2&w=412&q=75&f=webp)

### **Preferred Top Column**

Controls which column appears on top of the stack when NavigationSplitView collapses into a single stack in certain contexts, such as on iPhone, when iPhone Duo is closed, or on Apple Watch. By default, the sidebar appears on top. In this case, the detail column does instead.

![TextFieldLink - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/76/variants/192?v=1790073478842&r=2&w=412&q=75&f=webp)

### **TextFieldLink**

A control that requests text input from the user when pressed

![ViewThatFits - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/5/variants/1?v=1790073478842&r=2&w=412&q=75&f=webp)

### **ViewThatFits**

A view that adapts to the available space by providing the first child view that fits.

![Glass effect - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/85/variants/33?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Glass effect**

Applies the Liquid Glass effect to a view

![Button Tint - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/34/variants/408?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Button Tint**

Sets the buttons tint color

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility#webpage","@type":"WebPage","dateModified":"2025-12-27T10:03:38.269Z","datePublished":"2025-06-10T13:30:10.032Z","description":"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","name":"ToolbarItem Shared Background Visibility","url":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility","breadcrumb":{"@id":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility#article","dateModified":"2025-12-27T10:03:38.269Z","datePublished":"2025-06-10T13:30:10.032Z","description":"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","headline":"ToolbarItem Shared Background Visibility","inLanguage":"en-US","name":"ToolbarItem Shared Background Visibility","thumbnailUrl":"https://exploreswiftui.com/api/images/92/variants/295?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/toolbarcontent/sharedbackgroundvisibility(_:)","codeSampleType":"full example","description":"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","name":"ToolbarItem Shared Background Visibility SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"NavigationStack {\n  Text(\"Foo\")\n    .toolbar {\n    ToolbarItem {\n      Button(\"Account\", systemImage: \"person.circle\", action: action)\n    }\n    ToolbarItem {\n      Button(\"Account\", systemImage: \"person.circle\", action: action)\n    }\n    .sharedBackgroundVisibility(.hidden)\n  }\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Toolbars"},{"@type":"Thing","name":"ToolbarItem Shared Background Visibility"}]},{"@id":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"Toolbars","item":"https://exploreswiftui.com/library/toolbars","position":2},{"@type":"ListItem","name":"ToolbarItem Shared Background Visibility","item":"https://exploreswiftui.com/library/toolbars/toolbaritem-shared-background-visibility","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/92/variants/295?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/92/variants/295?v=1790073478842&r=2"}]}
```