<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/tabViewSidebarHeader(content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE03tabC13SidebarHeader7contentQrqd__yXE_tAaBRd__lF"
  },
  "title" : "tabViewSidebarHeader(content:)"
}
-->

# tabViewSidebarHeader(content:)

Adds a custom header to the sidebar of a tab view.

```
nonisolated func tabViewSidebarHeader<Content>(@ContentBuilder content: () -> Content) -> some View where Content : View
```

## Discussion

The header appears at the top of the sidebar before
any tab labels and can scroll with the content. The header is
only visible when the [`TabView`](/documentation/SwiftUI/TabView) is displaying the sidebar.

The following example adds a welcome message to
the top of the sidebar:

```
TabView {
    Tab("Home", systemImage: "house") {
        HomeView()
    }

    Tab("Alerts", systemImage: "bell") {
        AlertsView()
    }

    Tab("Browse", systemImage: "list.bullet") {
        MyBrowseView()
    }
}
.tabViewStyle(.sidebarAdaptable)
.tabViewSidebarHeader {
    WelcomeHeaderView()
}
```

> Note: To have a sidebar, a``doc://com.apple.SwiftUI/documentation/SwiftUI/TabView`` needs the
> ``doc://com.apple.SwiftUI/documentation/SwiftUI/TabViewStyle/sidebarAdaptable`` style.

---

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)