At WWDC26, SwiftUI received one of its most practical toolbar improvements since the introduction of toolbar customization APIs.
Until now, developers had very limited control over what happened when a toolbar ran out of space. SwiftUI made those decisions automatically, often resulting in important actions disappearing while less important actions remained visible.
The new toolbar APIs introduced in iOS 27, iPadOS 27, macOS 27, and visionOS 27 finally solve this problem by allowing developers to:
This article focuses on the new ToolbarOverflowMenu API and how it works together with toolbar placements and visibility priorities.
Apple introduced these APIs as part of a broader effort to improve adaptive interfaces across resizable windows and foldable layouts.
Consider a typical mail application toolbar:
On a large iPad screen everything fits perfectly.
However, on smaller devices or narrow window sizes, the toolbar starts collapsing.
Before iOS 27, SwiftUI decided which actions disappeared first. Developers had little control over that behavior.
This often resulted in awkward situations where destructive actions like Delete remained visible while frequently used actions like Search moved into the overflow menu.
WWDC26 changes that.
ToolbarOverflowMenuToolbarOverflowMenu represents a group of actions that should always appear inside the toolbar overflow menu regardless of available space or platform behavior.
.toolbar {
ToolbarOverflowMenu {
Button("Archive", systemImage: "archivebox") {
archive()
}
Button("Delete", systemImage: "trash") {
delete()
}
}
}On iOS and visionOS, these actions automatically appear inside the standard navigation bar overflow menu.
This means developers no longer need to create custom Menu items simply to hide secondary actions.
Imagine a document editor.
Some actions are critical:
Others are useful but less frequently used:
Using the new API:
struct DocumentView: View {
var body: some View {
NavigationStack {
TextEditor(text: $inputText)
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button("Search", systemImage: "magnifyingglass") {
search()
}
}
ToolbarItem(placement: .topBarTrailing) {
Button("Save", systemImage: "square.and.arrow.down") {
save()
}
}
ToolbarItem(placement: .topBarPinnedTrailing) {
Button("Share", systemImage: "square.and.arrow.up") {
share()
}
}
ToolbarOverflowMenu {
Button("Duplicate", systemImage: "plus.square.on.square") {
duplicate()
}
Button("Rename", systemImage: "pencil") {
rename()
}
Button("Export PDF", systemImage: "doc.richtext") {
exportPDF()
}
Button("Print", systemImage: "printer") {
printDocument()
}
Divider()
Button(
"Delete",
systemImage: "trash",
role: .destructive
) {
delete()
}
}
}
}
}
}The result is a toolbar that remains focused on the actions users perform most often while still providing access to advanced functionality.
Toolbar placement determines where an item appears before any overflow behavior occurs.
.topBarLeadingPositions content on the leading side of the navigation bar.
ToolbarItem(placement: .topBarLeading) {
Button("Search", systemImage: "magnifyingglass") {
}
}Typically used for:
.topBarTrailingPlaces content in the trailing section of the toolbar.
ToolbarItem(placement: .topBarTrailing) {
Button("Save") {
}
}Common use cases include:
.topBarPinnedTrailingIntroduced in WWDC26.
Unlike .topBarTrailing, this placement remains pinned to the trailing edge even while the toolbar reflows due to size changes. Apple specifically designed this placement for actions that should remain consistently accessible.
ToolbarItem(placement: .topBarPinnedTrailing) {
Button("Share", systemImage: "square.and.arrow.up") {
share()
}
}Great candidates include:
The second piece of the puzzle is visibilityPriority(_:).
When toolbar space becomes limited, SwiftUI starts moving items into the overflow menu.
The new modifier allows developers to influence that decision.
ToolbarItem {
Button("Search") {
}
}
.visibilityPriority(.high)Available priorities include:
.low
.automatic
.highThe default value is .automatic.
.toolbar {
ToolbarItem {
Button("Search", systemImage: "magnifyingglass") {
}
}
.visibilityPriority(.high)
ToolbarItem {
Button("Filter", systemImage: "line.3.horizontal.decrease.circle") {
}
}
.visibilityPriority(.automatic)
ToolbarItem {
Button("Archive", systemImage: "archivebox") {
}
}
.visibilityPriority(.low)
}When the available width shrinks:
This ordering is exactly what users expect.
If multiple toolbar items share the same priority, SwiftUI uses placement order to decide which item moves into overflow first.
Items closer to the trailing edge disappear before items located toward the leading edge.
For example:
Search | Filter | ArchiveIf all three use .automatic, SwiftUI will typically move:
Archive → Filter → SearchThis behavior mirrors AppKit's toolbar overflow strategy on macOS.
ToolbarOverflowMenu vs MenuDevelopers may wonder why ToolbarOverflowMenu exists when Menu already exists.
The difference is intent.
MenuRepresents an interactive menu that the user explicitly opens.
Menu("More") {
Button("Delete") { }
}ToolbarOverflowMenuRepresents toolbar actions that belong to the toolbar's adaptive overflow system.
ToolbarOverflowMenu {
Button("Delete") { }
}The system decides how and where to present those actions on each platform.
The overflow experience differs slightly depending on the platform.
| Platform | Behavior |
|---|---|
| iOS | Appears inside navigation bar overflow menu |
| iPadOS | Behaves similarly to iOS but adapts to wider layouts |
| macOS | Integrates with native toolbar overflow behavior |
| visionOS | Appears in the ornament toolbar overflow menu |
The API itself remains identical across all platforms.
After experimenting with these APIs, a good rule of thumb is:
A useful mental model is:
If users perform an action multiple times per session, it probably deserves a visible toolbar button.
ToolbarOverflowMenu?Use it when:
ToolbarOverflowMenu may not be the flashiest API introduced at WWDC26, but it solves a real problem that nearly every productivity app faces.
Combined with visibilityPriority(_:) and topBarPinnedTrailing, SwiftUI toolbars finally become predictable, adaptive, and developer-controlled.
Instead of fighting the system's automatic toolbar behavior, developers can now express intent:
The result is a toolbar that scales naturally from iPhone to Mac while keeping the most important actions exactly where users expect them to be.
For productivity apps, document editors, mail clients, and professional tools, this is one of the most useful SwiftUI additions of WWDC26.
If you have suggestions or opinion, feel free to connect with me on X and send me a DM. If this article helped you, Buy me a coffee.