tabViewSidebarBottomBar

Adds a custom bottom bar to the sidebar of a tab view.

View ModifieriOS 18.0+macOS 15.0+visionOS 2.0+tabViewSidebarBottomBar(content:) in SwiftUI

Declaration

React
compose().tabViewSidebarBottomBar({
  content: ReactNode,
})
Swift
nonisolated func tabViewSidebarBottomBar<Content>(
    @ContentBuilder content: () -> Content
) -> some View
where Content : View

Parameters

  • options.content*ReactNode

Discussion

The content is pinned at the bottom of the sidebar, so it's always visible when the sidebar is visible and doesn't scroll with the content.

The following example adds an account button to the bottom of the sidebar:

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

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

    Tab("Browse", systemImage: "list.bullet") {
        MyBrowseView()
    }
}
.tabViewStyle(.sidebarAdaptable)
.tabViewSidebarBottomBar {
    AccountButton()
}

See also

More in Navigation.