<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.0.0 - 27.0.0",
    "macOS: 10.15.0 - 27.0.0",
    "tvOS: 13.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 7.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/NavigationView/init(content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI14NavigationViewV7contentACyxGxyXE_tcfc"
  },
  "title" : "init(content:)"
}
-->

# init(content:)

Creates a destination-based navigation view.

```
nonisolated init(@ContentBuilder content: () -> Content)
```

## Parameters

`content`

A [`ViewBuilder`](/documentation/SwiftUI/ViewBuilder) that produces the content that
the navigation view wraps. Any views after the first act as
placeholders for corresponding columns in a multicolumn display.

## Discussion

Perform navigation by initializing a link with a destination view.
For example, consider a `ColorDetail` view that displays a color sample:

```
struct ColorDetail: View {
    var color: Color

    var body: some View {
        color
            .frame(width: 200, height: 200)
            .navigationTitle(color.description.capitalized)
    }
}
```

The following [`NavigationView`](/documentation/SwiftUI/NavigationView) presents three links to color detail
views:

```
NavigationView {
    List {
        NavigationLink("Purple", destination: ColorDetail(color: .purple))
        NavigationLink("Pink", destination: ColorDetail(color: .pink))
        NavigationLink("Orange", destination: ColorDetail(color: .orange))
    }
    .navigationTitle("Colors")

    Text("Select a Color") // A placeholder to show before selection.
}
```

When the horizontal size class is [`UserInterfaceSizeClass.regular`](/documentation/SwiftUI/UserInterfaceSizeClass/regular),
like on an iPad in landscape mode, or on a Mac,
the navigation view presents itself as a multicolumn view,
using its second and later content views — a single [`Text`](/documentation/SwiftUI/Text)
view in the example above — as a placeholder for the corresponding
column:

![A screenshot of a Mac window showing a multicolumn navigation view. The left column lists the colors Purple, Pink, and Orange, with none selected. The right column presents a placeholder view that says Select a Color.](images/com.apple.SwiftUI/NavigationView-init-content-1@2x.png)

When the user selects one of the navigation links from the
list, the linked destination view replaces the placeholder
text in the detail column:

![A screenshot of a Mac window showing a multicolumn navigation view. The left column lists the colors Purple, Pink, and Orange, with Purple selected. The right column presents a detail view that shows a purple square.](images/com.apple.SwiftUI/NavigationView-init-content-2@2x.png)

When the size class is [`UserInterfaceSizeClass.compact`](/documentation/SwiftUI/UserInterfaceSizeClass/compact), like
on an iPhone in portrait orientation, the navigation view presents
itself as a single column that the user navigates as a stack. Tapping
one of the links replaces the list with the detail view, which
provides a back button to return to the list:

![Two screenshots of an iPhone in portrait orientation connected by an arrow. The first screenshot shows a single column consisting of a list of colors with the names Purple, Pink, and Orange. The second screenshot has the title Purple, and contains a purple square. The arrow connects the Purple item in the list on the left to the screenshot on the right.](images/com.apple.SwiftUI/NavigationView-init-content-3@2x.png)

---

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)