<!--
{
  "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:)-63x0h",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15NavigationStackV4path4rootACyAA0C4PathVq_GAA7BindingVyAGG_q_yXEtcAGRszrlufc"
  },
  "title" : "init(path:root:)"
}
-->

# init(path:root:)

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

```
nonisolated init(path: Binding<NavigationPath>, @ContentBuilder root: () -> Root) where Data == NavigationPath
```

## Parameters

`path`

A `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:)`.

---

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)