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

# init(path:root:)

Creates a navigation stack with homogeneous navigation state that you can control.

## Declaration

```swift
nonisolated init(path: Binding<Data>, @ContentBuilder root: () -> Root) where Data : MutableCollection, Data : RandomAccessCollection, Data : RangeReplaceableCollection, Data.Element : Hashable
```

## Parameters

- `path`: A doc://com.apple.SwiftUI/documentation/SwiftUI/Binding to the navigation state for this stack.
- `root`: The view to display when the stack is empty.

## Mentioned in

Understanding the navigation stack Migrating to new navigation types

## Discussion

Discussion If you don’t need access to the navigation state, use init(root:).
