SidebarAdaptableTabViewStyle

A tab bar style that adapts to each platform.

StructureiOS 18.0+macOS 15.0+tvOS 18.0+visionOS 2.0+SidebarAdaptableTabViewStyle in SwiftUI

Declaration

React
type SidebarAdaptableTabViewStyle = SwiftOpaque<'SidebarAdaptableTabViewStyle'>;
Swift
nonisolated struct SidebarAdaptableTabViewStyle

Overview

Tab views using the sidebar adaptable style have an appearance that varies depending on the platform:

  • iPadOS displays a top tab bar that can adapt into a sidebar.
  • iOS displays a bottom tab bar.
  • macOS and tvOS always show a sidebar.
  • visionOS shows an ornament and also shows a sidebar for secondary tabs within a TabSection.

Use TabViewStyle.sidebarAdaptable to construct this style.

To apply this style to a tab view, or to a view that contains tab views, use the View.tabViewStyle(_:) modifier.

From Apple’s SwiftUI documentation. Code samples there are Swift.

See also

More in Styles.