/duology:duo-navigationfrom duology
Guides developers in correctly configuring toolbars, navigation bars, tab bars, split views, and sheets for iPhone Duo's foldable display where bars become vertical on the side. Use when bars go vertical, items overflow, tabs become sidebars, or sheets need fold-aware placement.
Ships in duology. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
On iPhone Duo the system can merge the navigation bar, the toolbar and the tab bar into one vertical bar on the side of the display. You get this for free when you build with the iOS 27.1 SDK and use the bars that system containers own. Your job is to keep those bars, give each item what it needs to move, rank items for overflow, and opt out only where horizontal bars serve a screen better.
Load other skills for neighbouring work: duo-layout (safe areas, margins, the fold in your own content), duo-continuity (state that must survive a fold), duo-patterns (which layout to pick).
Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1, inner display, fully open, held wide). Unverified means we could not confirm it. Everything else comes from Apple, linked inline. Sources: reference/sources.md.
| Context | Bars |
|---|---|
| Outer display (closed), portrait or landscape | One vertical bar on the side |
| Inner display, landscape (held wide) | One vertical bar on the side (measured: trailing edge) |
| Inner display, portrait (held tall) | Normal top and bottom bars |
| Split View multitasking on the inner display | Each app puts its bar on its own outer edge |
NavigationSplitView / UISplitViewController showing columns | Detail column vertical; sidebar and content columns horizontal (measured in SwiftUI) |
| Inspector | Horizontal |
| Sheet on the outer display | Vertical |
| Sheet on the inner display, centred (default) or leading | Horizontal (measured in SwiftUI) |
| Sheet on the inner display, trailing | Vertical (measured in SwiftUI) |
Sources: HIG, Vertical controls, Optimize bars for vertical presentation, Tech Talk 111462.
Details, container rules and probe results: references/bar-rules.md.
.toolbar to content inside NavigationStack, NavigationSplitView or a TabView tab.navigationItem and toolbarItems on a view controller inside UINavigationController or UITabBarController.UIToolbar, UINavigationBar or UITabBar you create yourself. In SwiftUI it is a row of buttons in safeAreaInset(edge: .bottom) (or .top) or in .overlay(alignment: .bottom). That row is your own content, so the system never moves it..toolbar: a bottom row into ToolbarItemGroup(placement: .bottomBar), a top row into .primaryAction items. Drop the Spacer()s. A lone floating button may stay; put it on the bar's side, near the thumb and clear of the bar's items (see "Adapt custom views to the bar" and duo-ergonomics). Recipe: references/swiftui.md.Menu labels included. Replace label: { Image(systemName: "…") } with Button("Sort", systemImage: "…"), Menu("Sort", systemImage: "…") { … } or a Label("Sort", systemImage: "…") label.Run both searches from the project root and review every hit. Keep the --include pattern quoted: unquoted, zsh stops with "no matches found" and exits 1, the same code grep gives for "no hits". No output and no error means no hits.
# Hand-built bars: UIKit bar views, SwiftUI rows pinned to the top or bottom edge.
grep -rnE 'UIToolbar\(|UINavigationBar\(|UITabBar\(|safeAreaInset\(edge: *\.(top|bottom)|overlay\(alignment: *\.(top|bottom)' --include='*.swift' .
# Icon-only labels: a bare Image on the `label: {` line or the line after it.
grep -rnE -A1 'label: *\{' --include='*.swift' . | grep -E 'Image\(systemName'
import SwiftUI
struct NoteEditor: View {
@Environment(\.dismiss) private var dismiss
@State private var text = ""
var body: some View {
NavigationStack {
TextEditor(text: $text)
.navigationTitle("Note")
.toolbar {
// First in the vertical bar: the way out.
ToolbarItem(placement: .cancellationAction) {
Button("Close", systemImage: "xmark", role: .close) { dismiss() }
}
// Second: the prominent action. Pinned items stay out of overflow.
ToolbarItem(placement: .topBarPinnedTrailing) {
Button("Done", systemImage: "checkmark", role: .confirm) { dismiss() }
}
// A group with symbols and titles, kept visible longer.
ToolbarItemGroup(placement: .bottomBar) {
Button("Checklist", systemImage: "checklist") {}
Button("Attach", systemImage: "paperclip") {}
}
.visibilityPriority(.high)
// Rare and destructive: first to overflow.
ToolbarItem(placement: .bottomBar) {
Button("Delete", systemImage: "trash", role: .destructive) {}
}
.visibilityPriority(.low)
// Always in the system overflow menu.
ToolbarOverflowMenu {
Button("Duplicate", systemImage: "plus.square.on.square") {}
Button("Print", systemImage: "printer") {}
}
}
}
}
}
Measured with a toolbar built the same way: Close, then Done, then the overflow button at the top of the vertical bar, and the bottom group at its foot.
.cancellationAction, or navigationItem.leadingItemGroups in UIKit with leftItemsSupplementBackButton left at false (hub)..topBarPinnedTrailing or navigationItem.pinnedTrailingGroup. A pinned SwiftUI item overflows only while search is active and space runs out (doc)..badge(7) or UIBarButtonItem.badge = .count(7). Keep text that carries facts, like a price, in the horizontal bar.ToolbarItemGroup, UIBarButtonItemGroup). Add no spacers, fixed or flexible: Apple asks apps not to add their own spacing on either axis. In the vertical bar fixed spacers keep their size and flexible ones shrink to zero (Tech Talk 111462)..high; lower rare ones with .low. Rank whole groups first, then single items (HIG).ToolbarOverflowMenu or navigationItem.additionalOverflowItems. Keep the ellipsis symbol for that menu only.axisBehavior value | Use for |
|---|---|
.automatic (default) | Symbol items go on either axis. Text items and custom views stay horizontal. |
.horizontalOnly | An item that swaps a symbol for text, like Select and Done. The item hides when no horizontal bar exists. |
.verticalPreferred | A custom view that fits the bar's fixed width, like a compass. |
import SwiftUI
struct PhotoGrid: View {
@State private var isSelecting = false
var body: some View {
NavigationStack {
Text("Photos")
.navigationTitle("Library")
.toolbar {
ToolbarItem(placement: .primaryAction) {
if isSelecting {
Button("Done") { isSelecting = false }
} else {
Button("Select", systemImage: "checkmark.circle") { isSelecting = true }
}
}
.axisBehavior(.horizontalOnly)
}
}
}
}
The system EditButton already stays horizontal. Measured: a .horizontalOnly item showed in the top bar next to the title.
Apple names three cases: a single screen with a bottom-heavy layout that doesn't scroll (Calculator), a full-screen video player with toolbar controls, and a sheet whose only item is Close (Tech Talk 111462, doc).
import SwiftUI
struct CalculatorScreen: View {
var body: some View {
NavigationStack {
Text("0")
.font(.largeTitle)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottomTrailing)
.toolbarVerticalBehavior(.disabled)
}
}
}
struct RecentsTab: View {
var body: some View {
TabView {
Tab("Recents", systemImage: "clock") {
NavigationStack {
Text("Files")
.toolbar {
Button("Up", systemImage: "chevron.up") {}
Button("Down", systemImage: "chevron.down") {}
}
// Task view: let the tab bar shrink before these items.
.toolbarVerticalCompressionBehavior(.prefersToolbarItems)
}
}
}
}
}
.disabled as a fixed choice per screen. Never toggle it from view state. To hide bars, use toolbarVisibility(_:for:) (doc).NavigationStack reads its top view, a TabView its selected tab, a NavigationSplitView its trailing column, a sheet its own content.preferredVerticalBarBehavior to return .disabled, and call setNeedsUpdateOfVerticalBarConfiguration() when the answer changes. Navigation and tab bar controllers forward to their visible child; a custom container overrides childForPreferredVerticalBarBehavior..prefersToolbarItems (SwiftUI) or .prefersBarItems (UIKit navigationItem.verticalBarCompressionBehavior) for task screens.import SwiftUI
struct CanvasScreen: View {
@Environment(\.toolbarVerticalEdge) private var barEdge
var body: some View {
ZStack {
Color.clear
// On the bar's side, near the thumb (Apple's toolbarVerticalEdge example); no bar: trailing.
Text("Palette")
.padding().background(.thinMaterial, in: .capsule)
.padding([.horizontal, .bottom], 16) // the margin next to the bar is 0 pt
.frame(maxWidth: .infinity, maxHeight: .infinity,
alignment: barEdge == .leading ? .bottomLeading : .bottomTrailing)
.contentMargins(for: .container)
}
}
}
toolbarVerticalEdge is nil where the system never places a vertical bar. Measured: it also reads nil inside a centred or leading sheet and under .toolbarVerticalBehavior(.disabled). UIKit's traitCollection.verticalBarEdge reads .unspecified (measured after opting out). Observe it with registerForTraitChanges(UITraitCollection.systemTraitsAffectingVerticalBarEdge)..backgroundExtensionEffect() or UIBackgroundExtensionView.Offer a sidebar for information-dense apps, not for every app (Tech Talk 111466).
import SwiftUI
struct HealthRoot: View {
var body: some View {
TabView {
Tab("Summary", systemImage: "heart") { SummaryScreen() }
Tab("Sharing", systemImage: "person.2") { Text("Sharing") }
Tab("Browse", systemImage: "square.grid.2x2") { Text("Browse") }
}
.tabViewStyle(.sidebarAdaptable) // defaultTabBarPlacement only applies to this style
.defaultTabBarPlacement(.sidebar)
}
}
struct SummaryScreen: View {
@Environment(\.isTabViewSidebarAvailable) private var hasSidebar
var body: some View {
Text(hasSidebar ? "Sidebar layout" : "Tab bar layout")
}
}
isTabViewSidebarAvailable is true. The tabBarPlacement environment value still said bottomBar, so gate on isTabViewSidebarAvailable, never on tabBarPlacement or size class.tabBarController.mode = .tabSidebar and tabBarController.sidebar.preferredPlacement = .sidebar. Measured: preferredPlacement alone gave no sidebar. Read sidebar.isAvailable and implement tabBarController(_:sidebarAvailabilityDidChange:).NavigationSplitView or UISplitViewController. Closed, they collapse to one stack. Open, they show columns. Partially folded, they even out the columns around the fold (Tech Talk 111461, Tech Talk 111463). Switching panes yourself? Opening on a pushed screen pops it: see references/swiftui.md.ArrangementView inside a NavigationStack or a TabView tab. Never put a navigation container inside an arrangement, and never put an arrangement inside a List or ScrollView (Tech Talk 111463).NavigationSplitView columns too. Apple's pages disagree here: the hub advises against it, while the HIG shows split views around arrangements. The stricter rule is the safe default.import SwiftUI
struct MapScreen: View {
@State private var showsPlace = false
var body: some View {
Button("Show place") { showsPlace = true }
.sheet(isPresented: $showsPlace) {
NavigationStack {
Text("Place details")
.toolbar {
Button("Close", systemImage: "xmark", role: .close) { showsPlace = false }
Button("Share", systemImage: "square.and.arrow.up") {}
}
}
.presentationDetents([.medium, .large])
.presentationPlacement(.trailing) // keeps the content behind in view; gets a vertical bar
}
}
}
.leading, .center or .trailing to keep the content behind the sheet in view, as Apple's map example does (doc). Only sheets read presentationPlacement(_:).sheetPresentationController?.preferredPlacement before you present. It is ignored when sourceView is set (UISheetPresentationController.h)..toolbarVerticalBehavior(.disabled) inside the sheet. On the outer display the sheet then stops short of the front camera (Tech Talk 111466).Full UIKit code: references/uikit.md. More SwiftUI: references/swiftui.md. iPhone Duo always runs iOS 27.1 or later, so gate these APIs with if #available (versions in references/bar-rules.md); the fallback runs only on other iPhones.
Build with Xcode 27.1 and run on the iPhone Duo simulator. In Device Hub, try Closed, Open (held wide and held tall), Partially Open, and Split View on each side; simctl cannot change poses. Find the Duo's UDID with xcrun simctl list devices booted (more in duo-setup); booted is ambiguous when several simulators run. Screenshot the outer display with xcrun simctl io <UDID> screenshot --display=primary outer.png and the inner one with xcrun simctl io <UDID> screenshot --display=primary-1 inner.png. Then tick:
UIToolbar, UINavigationBar or UITabBar, no SwiftUI button rows in safeAreaInset or an edge overlay, and no icon-only label: { Image(systemName:) } in bars or Menu labels..prefersToolbarItems / .prefersBarItems.toolbarVerticalEdge / verticalBarEdge and uses margins, not fixed insets..sidebarAdaptable + .defaultTabBarPlacement(.sidebar), or mode = .tabSidebar + preferredPlacement = .sidebar.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
iphone-duo, foldable, navigation-bar, toolbar, tab-bar, split-view
npx claudepluginhub kimeur/duology --plugin duology6 skills in this plugin
/duo-continuityKeeps app state alive when iPhone Duo, Apple's foldable, folds, unfolds, rotates or resizes between the outer display and the inner display. Use when scroll position, video or audio playback, typed text, keyboard focus, selection, form input, the selected item, the navigation stack, an upload or sign-in resets or reloads on fold or unfold, and when writing or reviewing @Observable models, @SceneStorage, NavigationPath, NavigationSplitView, ScrollPosition, AnyLayout, .id, onAppear, .task, registerForTraitChanges or viewWillTransition(to:with:)./duo-layoutCore layout rules for iPhone Duo, Apple's foldable. Use when content lands in the fold, a screen breaks on the inner or outer display, or you write SwiftUI or UIKit layout for a foldable. Covers size classes instead of UIScreen.main, idiom or orientation, asymmetric safe areas and margins, reserved regions (ReservedRegion, reservedRegions(kind:options:), .division, .occlusion, .includeInactive), ArrangementView and UIArrangementViewController (split and overlay styles), an even custom split (EvenSplit) for two halves that must always show, even grid columns, and keeping controls off the fold./duo-scenesScenes and windows on iPhone Duo, Apple's foldable. Use when an app opens a second window (openWindow, WindowGroup(for:), activateSceneSession, UISceneSessionActivationRequest, UIWindowScene.ActivationAction), handles new-window requests on the outer display and their errors, asks before a window closes (closureConfirmation), runs in 50/50 Split View, shows content on the outer display while the camera runs on the inner display (sceneAccessory, CameraCaptureAccessory, onAvailabilityChange, UISceneAccessory, registerSceneAccessory, UISceneAccessoryRegistration, windowCameraCaptureAccessory, ExternalNonInteractiveAccessory), restores state per window (@SceneStorage, stateRestorationActivity), or reacts to the UIScene lifecycle when the phone folds or unfolds (scenePhase, didUpdateEffectiveGeometry, UIWindowScene.screen).Other plugins' skills for the same job