Switches between the main sections of an app with SwiftUI's native tab bar.
Usage
The native TabView already brings the Liquid Glass tab bar, its layout on iPhone and iPad, and accessibility, so use it directly and put your screens inside:
Give each tab its own NavigationStack, so each section keeps its place when people switch tabs.
Use tabs to move between the main sections of your app, not to perform actions. For actions on the current screen, use a toolbar. Give every tab a short label and an SF Symbol, preferably a filled one.
Examples
Badge
.badge(_:) shows a count or a short label on a tab. Keep badges for information that needs attention.
Search
Tab(role: .search) adds a search tab, which the system places at the trailing end of the tab bar. This example also gives each tab a value and binds the selection, so you can change tabs in code.
iOS 16 and 17
Tab needs iOS 18. On earlier versions, put .tabItem(_:) on each screen. It looks the same.
Minimize on scroll
On iOS 26 and later, .tabBarMinimizeBehavior(.onScrollDown) shrinks the tab bar while people scroll down, so content gets more room:
iPad
On iPad, the tab bar appears near the top of the screen. .tabViewStyle(.sidebarAdaptable) adds a button that turns it into a sidebar, for apps with more sections.
Color
The selected tab uses the theme's tint, which .flxTheme(_:) applies at the root of your app.
Tab View or Segmented Control
Use a tab view for the main sections of your app. To switch between closely related views inside one screen, use a Segmented Control.
For more information, see the Human Interface Guidelines for tab bars and the Apple documentation.







