Greetings, traveler!
SwiftUI has a new modifier for controlling how a toolbar behaves while the user scrolls:
.toolbarMinimizeBehavior(.onScrollDown, for: .navigationBar)When the content scrolls down, SwiftUI can minimize the navigation bar. This gives more space to the content without manually hiding the bar or building a custom scroll tracking system.
Apple shows this exact pattern with a ScrollView:
ScrollView {
StickerListView()
}
.toolbarMinimizeBehavior(.onScrollDown, for: .navigationBar)How it works
The modifier is defined on View:
nonisolated func toolbarMinimizeBehavior(
_ behavior: ToolbarMinimizeBehavior,
for bars: ToolbarPlacement...
) -> some ViewThe first parameter describes the minimization behavior. The second parameter defines which toolbar placement should use that behavior.
Example
struct LibraryView: View {
var body: some View {
NavigationStack {
ScrollView {
LazyVStack(spacing: 12) {
ForEach(0..<50) { index in
Text("Item \(index)")
.frame(maxWidth: .infinity, alignment: .leading)
.padding()
}
}
.padding()
}
.navigationTitle("Library")
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("Edit") {
// Handle edit
}
}
}
.toolbarMinimizeBehavior(.onScrollDown, for: .navigationBar)
}
}
}The scroll view provides the interaction, and SwiftUI handles the minimization behavior for the navigation bar.
Safe area behavior
By default, the safe area adjusts while the navigation bar minimizes. If you need control over that behavior, SwiftUI provides a related modifier:
.toolbarMinimizationSafeAreaAdjustment(...)That part is worth checking on screens with custom headers, pinned content, or edge-to-edge layouts. For a regular scrolling screen, the default behavior is usually the starting point.
Integrated top tab bars
When the navigation bar minimizes, an integrated top tab bar minimizes with it. That does not mean every TabView suddenly behaves this way. The note is about an integrated top tab bar that belongs to the navigation area. If your app uses this kind of layout, the toolbar minimization can affect both pieces of top chrome together.
Conclusion
This modifier fits screens where scrolling is the main interaction: feeds, libraries, search results, collections, or long content pages.
It is less useful on screens where toolbar actions must stay visible all the time. In those cases, minimizing the navigation bar may make the interface feel less predictable.
The good part is that SwiftUI now gives us a system API for this behavior. We no longer need to fake it with scroll offsets and custom navigation bar state.
