<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/NavigationStack/init(path:root:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15NavigationStackV4path4rootACyxq_GAA7BindingVyxG_q_yXEtcSMRzSkRzSmRzSH7ElementSTRpzrlufc::OverloadGroup"
  },
  "title" : "init(path:root:)"
}
-->

# init(path:root:)

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

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

## Parameters

`path`

A [`Binding`](/documentation/SwiftUI/Binding) to the navigation state for this stack.

`root`

The view to display when the stack is empty.

## Discussion

If you don’t need access to the navigation state, use [`init(root:)`](/documentation/SwiftUI/NavigationStack/init(root:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)