Interactive previews iPhone Duo

Axis Behavior

The bar axis behavior of the toolbar item.

Axis Behavior - Preview Not Available

Platform Compatibility

iOS 27.1+ iPadOS 27.1+

Tags

SwiftUI Code

Docs
 NavigationStack {
            Text("FooBar")
                .toolbar {
                    ToolbarItem {
                        Button(role: .confirm, action: action)
                    }
                    ToolbarItem {
                        Button(role: .cancel, action: action)
                    }
                    .axisBehavior(.horizontalOnly)
                    ToolbarItem {
                        Button("Foo", action: action)
                    }
                    ToolbarItem {
                        Button("Bar", action: action)
                    }
                    .axisBehavior(.verticalPreferred)
                }
}

Found an issue or have a suggestion?

Created: September 24, 2026Updated: September 28, 2026

More Toolbars Components

View all
Prefer Vertical Toolbar Items - iOS on iPhone Duo - Landscape - Closed - Liquid Glass - Light Mode - Preview
modifier

Prefer Vertical Toolbar Items

A compression behavior that prioritizes keeping toolbar items visible over other elements, such as tabs. By default, tabs are prioritized.

Toolbar Item Visibility Priority - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Toolbar Item Visibility Priority

Defines the visibility priority for a toolbar item.

Toolbar Overflow Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Toolbar Overflow Menu

The overflow menu of a toolbar. An overflow menu represents actions that are always placed in the toolbar’s overflow menu, regardless of the toolbar mode, platform, or customizability.

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.

Remove Toolbar Item Margin - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Remove Toolbar Item Margin

Configures whether the content margins are removed.

Title Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializers

Title Toolbar Item Placement

Places content in the title area

ToolbarItem Shared Background Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

ToolbarItem Shared Background Visibility

Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping

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

ToolbarSpacer

A standard space item in toolbars

Explore Other Components

Browse all
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.

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

ViewThatFits

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

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

LinearCapacityGaugeStyle

A gauge style that displays a bar that fills from leading to trailing edges as the gauge’s current value increases

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

Slider

Creates a slider to select a value from a given range

Refreshable List - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

Refreshable List

Marks this view as refreshable.

Role Button With Default Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Role Button With Default Label

Creates a button that displays a default label.

Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Button Sizing

The preferred sizing behavior of buttons in the view hierarchy.

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