Interactive previews iPhone

Navigation Container Background

Sets the container background of the enclosing container using a view.

Navigation Container Background - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 17.0+ iPadOS 17.0+ macOS 14.0+ watchOS 1.0+ tvOS 17.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
NavigationStack {
            Text("Foo")
                .containerBackground(.blue.gradient, for: .navigation)
        }

Found an issue or have a suggestion?

Created: March 15, 2026Updated: March 15, 2026

More View Components

View all
Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Scroll Gesture Axis Lock

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview
type

VisionOS background materials

All background materials on visionOS

Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Container Content Margins

Adds the margins of the container the view is in.

Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
environment

Toolbar Vertical Edge

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
structure

Hinge State

A type encapsulating the state of a single hinge.

Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
modifier

Disabled Toolbar Vertical Behavior

Disables the vertical bar.

Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Music Picker

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

App Store Overlay - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

App Store Overlay

Presents a StoreKit overlay when a given condition is true.

Explore Other Components

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

SegmentedPickerStyle

A picker style that presents the options in a segmented control. Use this style when there are two to five options. Consider using menu when there are more than five options.

Disable Automatic Photos Picker Dismissal - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Disable Automatic Photos Picker Dismissal

Prevents the Photos picker from dismissing automatically. Without this modifier, the Photos picker would automatically dismiss when an image is tapped.

Wheel Picker Item Height - watchOS - Liquid Glass - Light Mode - Preview
modifier

Wheel Picker Item Height

Sets the default wheel-style picker item height.

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

LinearProgressViewStyle

A progress view that visually indicates its progress using a horizontal bar

Custom Value Label Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Custom Value Label Picker

Creates a picker that generates its label from a localized string key and accepts a custom current value label.

Disclosure Group - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
initializer

Disclosure Group

A view that shows or hides another content view, based on the state of a disclosure control.

Gauge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Gauge

Creates a gauge showing a value within a range and describes the gauge’s purpose and current value

ViewThatFits Vertical - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
initializer

ViewThatFits Vertical

A view that adapts to the available vertical space by providing the first child view that fits.