navigationDestination for programmatic pushes, navigationTitle to set the title text, and the navigationBar* modifiers to fine-tune title size and back button visibility.
All four modifiers are typically applied to the content inside a NavigationStack — either the root view or a pushed destination view.
navigationDestination
Programmatically presents a navigation destination view.object
required
Configuration for the navigation destination.
This modifier provides programmatic control over navigation, as opposed to NavigationLink which navigates on tap. The destination view is pushed onto the NavigationStack; when the user taps the back button,
setIsPresented is called with false.navigationTitle
Sets the navigation bar title.string
required
The text to display in the navigation bar.
This modifier must be used within a NavigationStack to have a visible effect. The title appears in the navigation bar and is also used as the back button label when a child view is pushed.
navigationBarBackButtonHidden
Hides the navigation bar back button.Whether the back button is hidden. Defaults to
true.This modifier is typically applied to a destination view within a NavigationStack. When hiding the back button, consider providing an alternative way for the user to navigate back.
navigationBarTitleDisplayMode
Sets the navigation bar title display mode.string
required
The title display mode:
"large"— a large, scrollable title that collapses as the user scrolls"inline"— a small, centered title in the navigation bar"automatic"— inherits the display mode from the navigation context
The
"large" mode shows a prominent title that smoothly transitions to an inline title as the user scrolls down — the default for root-level views in a navigation stack. The "inline" mode always shows a compact title centered in the navigation bar, typical for detail/pushed views. Apply this modifier to content within a NavigationStack.See also
- NavigationStack — navigation container
- NavigationLink — tap-to-navigate link
- Toolbar — toolbar items and visibility
- Presentation — modal sheets and full-screen covers