<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/navigationDestination(item:destination:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE21navigationDestination4item11destinationQrAA7BindingVyqd__SgG_qd_0_qd__ctSHRd__AaBRd_0_r0_lF"
  },
  "title" : "navigationDestination(item:destination:)"
}
-->

# navigationDestination(item:destination:)

Associates a destination view with a bound value for use within a
navigation stack or navigation split view

```
nonisolated func navigationDestination<D, C>(item: Binding<Optional<D>>, @ContentBuilder destination: @escaping (D) -> C) -> some View where D : Hashable, C : View
```

## Parameters

`item`

A binding to the data presented, or `nil` if nothing is
currently presented.

`destination`

A content builder that defines a view to display
when `item` is not `nil`.

## Discussion

Add this view modifier to a view inside a [`NavigationStack`](/documentation/SwiftUI/NavigationStack) or
[`NavigationSplitView`](/documentation/SwiftUI/NavigationSplitView) to describe the view that the stack displays
when presenting a particular kind of data. Programmatically update
the binding to display or remove the view. For example, you can replace
the view showing in the detail column of a navigation split view:

```
@State private var colorShown: Color?

NavigationSplitView {
    List {
        Button("Mint") { colorShown = .mint }
        Button("Pink") { colorShown = .pink }
        Button("Teal") { colorShown = .teal }
    }
    .navigationDestination(item: $colorShown) { color in
        ColorDetail(color: color)
    }
} detail: {
    Text("Select a color")
}
```

When the person using the app taps on the Mint button, the mint color
shows in the detail and `colorShown` gets the value `Color.mint`. You
can reset the navigation split view to show the message “Select a color”
by setting `colorShown` back to `nil`.

You can add more than one navigation destination modifier to the stack
if it needs to present more than one kind of data.

Do not put a navigation destination modifier inside a “lazy” container,
like [`List`](/documentation/SwiftUI/List) or [`LazyVStack`](/documentation/SwiftUI/LazyVStack). These containers create child views
only when needed to render on screen. Add the navigation destination
modifier outside these containers so that the navigation split view can
always see the destination.

---

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)