Interactive previews iPhone

Value Tab View

Creates a tab view that uses a builder to create and specify selection values for its tabs.

Value Tab View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 18.0+ iPadOS 18.0+ macOS 15.0+ watchOS 11.0+ tvOS 18.0+ visionOS 2.0+

Tags

SwiftUI Code

Docs
@State var selection = "1"

var body: some View {
    let displayedSelection = Text("Selected: \(selection)")

    TabView(selection: $selection) {
        Tab(value: "0") {
            displayedSelection
        }
        Tab("1", systemImage: "1.circle", value: "1") {
            displayedSelection
        }

        Tab("2", image: "cats24x24", value: "2") {
            displayedSelection
        }
        Tab(value: "3") {
            displayedSelection
        } label: {
            Label("3", systemImage: "3.circle")
        }
    }
}

Found an issue or have a suggestion?

Created: April 11, 2026Updated: April 11, 2026

More TabView Components

View all
Collapse Sidebar Sections by Default - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Collapse Sidebar Sections by Default

Collapses the section in the sidebar by default.

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.

Explore Other Components

Browse all
MenuControlGroupStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

MenuControlGroupStyle

A control group style that presents its content as a menu when the user presses the control, or as a submenu when nested within a larger menu

DatePicker Components  - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

DatePicker Components

A date picker with only one displayed component

System Image Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

System Image Label

Creates a label with a system icon image and a title generated from a localized string.

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

AccessoryCircularGaugeStyle

A gauge style that displays an open ring with a marker that appears at a point along the ring to indicate the gauge’s current value

Pinned Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Pinned Toolbar Item Placement

A placement that pins the item to the trailing edge of the toolbar.

Label Styles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Label Styles

Sets the style for labels within this view.

Group Subscription Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Group Subscription Store View

Creates a view that loads all subscriptions in a subscription group from the App Store, and merchandises them with automatic marketing content.

Uniform Concentric Rectangle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Uniform Concentric Rectangle

Create a rectangle with the same corner style set on four corners.