---
title: "navigationDocument(_:preview:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/navigationdocument(_:preview:)"
---

# navigationDocument(_:preview:)

Configures the view’s document for purposes of navigation.

## Declaration

```swift
nonisolated func navigationDocument<D, I1, I2>(_ document: D, preview: SharePreview<I1, I2>) -> some View where D : Transferable, I1 : Transferable, I2 : Transferable

```

## Parameters

- `document`: The transferable content associated to the navigation title.
- `preview`: The preview of the document to use when sharing.

## Discussion

Discussion In iOS, iPadOS, this populates the title menu with a header previewing the document. In macOS, this populates a proxy icon. Refer to the Configure your apps navigation titles article for more information on navigation document modifiers.

## See Also

### Setting titles for navigation content

- [navigationTitle(_:)](swiftui/view/navigationtitle(_:).md)
- [navigationSubtitle(_:)](swiftui/view/navigationsubtitle(_:).md)
- [navigationDocument(_:)](swiftui/view/navigationdocument(_:).md)
