Interactive previews iPad

Collapse Sidebar Sections by Default

Collapses the section in the sidebar by default.

Collapse Sidebar Sections by Default - Preview Not Available

Platform Compatibility

iOS 27.0+ iPadOS 27.0+ macOS 27.0+ watchOS 27.0+ tvOS 27.0+ visionOS 27.0+

Tags

SwiftUI Code

Docs
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

More TabView Components

View all
Default Tab Bar Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Default Tab Bar Placement

Specifies the preferred placement for the tabs of a TabView in the sidebarAdaptable style on platforms where the tab bar cannot adapt between different representations, and only one representation can be shown. For example, on iOS, it can enforce the sidebar on large-screen devices like the Pro Max, and iPhone Duo. This modifier has no effect on iPadOS.

Default Collapsed Tab Section - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Default Collapsed Tab Section

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

Tab View Customization Behavior - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab View Customization Behavior

Configures the customization behavior of customizable tab view content.

Tab View Customization - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab View Customization

Specifies the customizations to apply to the sidebar representation of the tab view.

Tab View Side Bar Footer - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab View Side Bar Footer

Adds a custom footer to the sidebar of a tab view.

Tab View Side Bar Bottom Bar - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab View Side Bar Bottom Bar

Adds a custom bottom bar to the sidebar of a tab view.

Default Adaptable Tab Bar Placement - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Default Adaptable Tab Bar Placement

Specifies the default placement for the tabs in a tab view using the adaptable sidebar style.

Tab Bar Section Actions - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab Bar Section Actions

Adds custom actions to a tab section.

Explore Other Components

Browse all
Horizontal Radio Group Layout - macOS - Liquid Glass - Light Mode - Preview
modifier

Horizontal Radio Group Layout

Sets the style for radio group style pickers within this view to be horizontally positioned with the radio buttons inside the layout.

Placeholder Icon Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Placeholder Icon Store View

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using an image and a custom placeholder icon.

MenuPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

MenuPickerStyle

A picker style that presents the options as a menu when the user presses a button, or as a submenu when nested within a larger menu.

Picker Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Picker Divider

A Picker with a Divider

Vertical Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Vertical Divider

A vertical visual element that can be used to separate other content

List Background Prominence - macOS - Flat Design - Light Mode - Preview
environment

List Background Prominence

The prominence of the background underneath views associated with this environment.

AccessoryCircularCapacityGaugeStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

AccessoryCircularCapacityGaugeStyle

A gauge style that displays a closed ring that’s partially filled in to indicate the gauge’s current value

InsetListStyle - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
style

InsetListStyle

The list style that describes the behavior and appearance of an inset list.