---
title: "init(root:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/navigationstack/init(root:)"
---

# init(root:)

Creates a navigation stack that manages its own navigation state.

## Declaration

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

## Parameters

- `root`: The view to display when the stack is empty.
