Skip to content

Glassifying Tabs (SwiftUI)

A SwiftUI guide for coding agents. Also covers liquid glass tab bar, tab api tabview, sidebaradaptable, tabviewbottomaccessory, tabbarminimizebehavior, search tab role.

Liquid Glass, from WWDC25, reshapes tab navigation. The Tab API from iOS 18 is the entry ticket: the old TabView item style still renders glassy, but only the new API gets the new interactions, the search role, the bottom accessory, and minimize-on-scroll.

The Tab API with selection

Wrap each tab's content in a Tab. Bind selection through value:, and store it in @SceneStorage so state restoration brings the user back to the same tab.

@SceneStorage("selectedTab") private var selectedTabIndex = 0

TabView(selection: $selectedTabIndex) {
  Tab("feed", systemImage: "list.star", value: 0) { /* content */ }
  Tab("settings", systemImage: "gear", value: 1) { /* content */ }
}

The search role

role: .search is the only TabRole so far. The system separates that tab from the others on iOS and styles it as the search affordance.

Tab("search", systemImage: "magnifyingglass", value: 2, role: .search) {
  // content
}

Tabs become a sidebar automatically

tabViewStyle(.sidebarAdaptable) keeps tabs on iOS and watchOS and swaps them for a sidebar on iPadOS and macOS without a hand-built sidebar.

TabView(selection: $selectedTabIndex) { /* tabs */ }
  .tabViewStyle(.sidebarAdaptable)

Accessory view and minimize behavior

tabViewBottomAccessory pins an always-visible view above the tab bar, the Apple Music now-playing pattern, meant for global status or one global action. tabBarMinimizeBehavior collapses the bar to the current tab while the user scrolls.

TabView(selection: $selectedTabIndex) { /* tabs */ }
  .tabViewStyle(.sidebarAdaptable)
  .tabBarMinimizeBehavior(.onScrollDown)
  .tabViewBottomAccessory {
    Button("Do Action") { }
  }

Use this guidance in your coding agent

Install the Better Design MCP once. Your agent then loads this page with one call.

get-swiftui-guide({ topic: "swiftui-glassifying-tabs" })
claude mcp add --scope user better-design --transport http https://better-design.com/api/mcp --header "Authorization: Bearer <YOUR_API_KEY>"
Browse related design systems