Collapse Sidebar Sections by Default
Collapses the section in the sidebar by default.
Platform Compatibility
iOS 27.0+ iPadOS 27.0+ macOS 27.0+ watchOS 27.0+ tvOS 27.0+ visionOS 27.0+
Tags
SwiftUI Code
TabView {
TabSection("Foo") {
Tab("1", systemImage: "1.circle") {
Text("0")
}
}
.defaultSectionExpansion(.collapsed)
TabSection("Bar") {
Tab("3", systemImage: "3.circle") {
Text("2")
}
}
TabSection("FooBar") {
Tab("5", systemImage: "5.circle") {
Text("4")
}
}
}
.tabViewStyle(.sidebarAdaptable)Found an issue or have a suggestion?
Created: October 21, 2026Updated: October 21, 2026