iPhone Duo SwiftUI examples
Explore SwiftUI APIs, components, and modifiers on iPhone Duo. Compare portrait and landscape layouts in closed, partially open, and fully open states, with Swift code and Apple documentation.
20elements
Toolbars
Axis Behavior
The bar axis behavior of the toolbar item.
Explore Axis Behavior on iPhone Duo in portrait and landscape across closed, partially open, and fully open states, with SwiftUI code and Apple API documentation.
SwiftUI code
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)
}
}Compatibility
iOS 27.1+ iPadOS 27.1+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone Duo screenshot for Axis Behavior.