---
title: "iPhone Duo SwiftUI APIs & Layout Examples | Explore SwiftUI"
description: "Explore SwiftUI on iPhone Duo with visual examples, Swift code, and Apple documentation. Compare portrait and landscape layouts across hinge states."
canonical_url: "https://exploreswiftui.com/duo"
meta:
  author: "Explore SwiftUI"
  "og:description": "Explore SwiftUI on iPhone Duo with visual examples, Swift code, and Apple documentation. Compare portrait and landscape layouts across hinge states."
  "og:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_iPhone%2BDuo%2BSwiftUI%2BLayouts%2Cdescription_Explore%2BSwiftUI%2BAPIs%2Band%2Bcompare%2BiPhone%2BDuo%2Blayouts%2Bacross%2Borientations%2Band%2Bhinge%2Bstates.%2Cp_Ii9kdW8i%2Cs_5vZWWX1XkoagTswF.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "iPhone Duo SwiftUI APIs & Layout Examples | Explore SwiftUI"
  "twitter:description": "Explore SwiftUI on iPhone Duo with visual examples, Swift code, and Apple documentation. Compare portrait and landscape layouts across hinge states."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_iPhone%2BDuo%2BSwiftUI%2BLayouts%2Cdescription_Explore%2BSwiftUI%2BAPIs%2Band%2Bcompare%2BiPhone%2BDuo%2Blayouts%2Bacross%2Borientations%2Band%2Bhinge%2Bstates.%2Cp_Ii9kdW8i%2Cs_5vZWWX1XkoagTswF.png"
  "twitter:title": "iPhone Duo SwiftUI APIs & Layout Examples | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

# **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.

****19****elements

**Toolbars**

## **Prefer Vertical Toolbar Items**

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

Explore Prefer Vertical Toolbar Items on iPhone Duo in portrait and landscape across closed, partially open, and fully open states, with SwiftUI code and Apple API documentation.

### **SwiftUI code **

[ Full details](https://exploreswiftui.com/library/toolbars/prefer-vertical-toolbar-items?os=ios-duo&orientation=landscape&posture=closed&design=liquid&bezel=on) [ Docs](https://developer.apple.com/documentation/swiftui/toolbarverticalcompressionbehavior/preferstoolbaritems?changes=_3_14)

```
TabView {
    Tab("A", systemImage: "a.square") {
        NavigationStack {
            Text("FooBar")
                .toolbar {
                    ToolbarItem {
                        Button("1", systemImage: "1.circle", action: action)
                    }
                    ToolbarItem {
                        Button("2", systemImage: "2.circle", action: action)
                    }
                    ToolbarItem {
                        Button("3", systemImage: "3.circle", action: action)
                    }
                    ToolbarItem {
                        Button("4", systemImage: "4.circle", action: action)
                    }
                    ToolbarItem {
                        Button("5", systemImage: "5.circle", action: action)
                    }
                }
                .toolbarVerticalCompressionBehavior(.prefersToolbarItems)
            }
        }
    Tab("B", systemImage: "b.square") {}
    Tab("C", systemImage: "c.square") {}
    Tab("D", systemImage: "d.square") {}
    Tab("E", systemImage: "e.square") {}
    Tab("F", systemImage: "f.square") {}
}
```

### **Compatibility **

**iOS 27.1+ ****iPadOS 27.1+ **

### **Tags **

### **Found an issue or have a suggestion? **

## **All variants **

Every available iPhone Duo screenshot for Prefer Vertical Toolbar Items.

6 views

```json
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://exploreswiftui.com/duo#collectionpage","name":"iPhone Duo SwiftUI APIs & Layout Examples","description":"Explore SwiftUI on iPhone Duo with visual examples, Swift code, and Apple documentation. Compare portrait and landscape layouts across hinge states.","url":"https://exploreswiftui.com/duo","inLanguage":"en-US","isPartOf":{"@id":"https://exploreswiftui.com/#website"},"about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"iPhone Duo"}],"mainEntity":{"@id":"https://exploreswiftui.com/duo#itemlist"}},{"@type":"ItemList","@id":"https://exploreswiftui.com/duo#itemlist","name":"SwiftUI APIs and components with iPhone Duo previews","numberOfItems":19,"itemListElement":[{"@type":"ListItem","position":1,"name":"Prefer Vertical Toolbar Items","url":"https://exploreswiftui.com/duo?element=248"},{"@type":"ListItem","position":2,"name":"Axis Behavior","url":"https://exploreswiftui.com/duo?element=247"},{"@type":"ListItem","position":3,"name":"Preferred Top Column","url":"https://exploreswiftui.com/duo?element=256"},{"@type":"ListItem","position":4,"name":"Content NavigationSplitView","url":"https://exploreswiftui.com/duo?element=242"},{"@type":"ListItem","position":5,"name":"NavigationSplitView","url":"https://exploreswiftui.com/duo?element=241"},{"@type":"ListItem","position":6,"name":"Hide Sidebar Toggle","url":"https://exploreswiftui.com/duo?element=255"},{"@type":"ListItem","position":7,"name":"Container Content Margins","url":"https://exploreswiftui.com/duo?element=257"},{"@type":"ListItem","position":8,"name":"Disabled Toolbar Vertical Behavior","url":"https://exploreswiftui.com/duo?element=246"},{"@type":"ListItem","position":9,"name":"Toolbar Vertical Edge","url":"https://exploreswiftui.com/duo?element=254"},{"@type":"ListItem","position":10,"name":"Hinge State","url":"https://exploreswiftui.com/duo?element=249"},{"@type":"ListItem","position":11,"name":"TabView","url":"https://exploreswiftui.com/duo?element=155"},{"@type":"ListItem","position":12,"name":"Sheet Placement","url":"https://exploreswiftui.com/duo?element=231"},{"@type":"ListItem","position":13,"name":"ArrangementView","url":"https://exploreswiftui.com/duo?element=243"},{"@type":"ListItem","position":14,"name":"Overlay Arrangement Style","url":"https://exploreswiftui.com/duo?element=250"},{"@type":"ListItem","position":15,"name":"Only Horizontal Split Arrangement Style","url":"https://exploreswiftui.com/duo?element=245"},{"@type":"ListItem","position":16,"name":"Overlay Arrangement Edge","url":"https://exploreswiftui.com/duo?element=251"},{"@type":"ListItem","position":17,"name":"Split Arrangement Layout Ratio","url":"https://exploreswiftui.com/duo?element=244"},{"@type":"ListItem","position":18,"name":"Overlay Arrangement ZIndex","url":"https://exploreswiftui.com/duo?element=252"},{"@type":"ListItem","position":19,"name":"Reserved Regions","url":"https://exploreswiftui.com/duo?element=253"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://exploreswiftui.com"},{"@type":"ListItem","position":2,"name":"iPhone Duo","item":"https://exploreswiftui.com/duo"}]}]}
```

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/duo#webpage","@type":"WebPage","description":"Explore SwiftUI on iPhone Duo with visual examples, Swift code, and Apple documentation. Compare portrait and landscape layouts across hinge states.","name":"iPhone Duo SwiftUI APIs & Layout Examples","url":"https://exploreswiftui.com/duo","isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/duo"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"}]}
```