Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
View

NavigationStack

A view that displays a root view and pushes views on top of it.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
fun NavigationStack(modifier: Modifier = Modifier, content: @Composable () -> Unit)

Overview

Use the plain form for a single screen with a title, or NavigationStack(path, onPathChange, destination) to drive navigation from Kotlin state. With Navigation 3, use NavDisplay.

NavigationStack {
    List(modifier = Modifier.navigationTitle("Inbox")) { /* rows */ }
}

This is the Kotlin form of SwiftUI NavigationStack.init(root:): SwiftUI documentation. In Swift it reads:

nonisolated init(@ContentBuilder root: () -> Root) where Data == NavigationPath

Topics

Creating a NavigationStack

fun NavigationStack(modifier: Modifier = Modifier, content: @Composable () -> Unit)
SwiftUI NavigationStack.init(root:)