Default Collapsed Tab Section

Sets the default expansion state for the section containing this tab to collapsed when displayed in the sidebar.

Default Collapsed Tab Section - iPadOS Liquid Glass Light Mode Preview

Platform Compatibility

iOS 27.0+ iPadOS 27.0+ visionOS 27.0+

Tags

SwiftUI Code

Docs
TabView {
    TabSection("Foo") {
        Tab {
            Text("0")
        } label: {
            Text("1")
        }
    }

    TabSection("Bar") {
        Tab {
            Text("2")
        } label: {
            Text("3")
        }
    }
    .defaultSectionExpansion(.collapsed)

    TabSection("FooBar") {
        Tab {
            Text("4")
        } label: {
            Text("5")
        }
    }
}
.tabViewStyle(.sidebarAdaptable)

Found an issue or have a suggestion?

Created: August 23, 2026Updated: August 23, 2026
Connect Wizard

Connect Wizard

Unlock insights App Store Connect doesn’t show you.

Get Started