---
title: "quickLookPreview(_:in:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/quicklookpreview(_:in:)"
---

# quickLookPreview(_:in:)

Presents a Quick Look preview of the URLs you provide.

## Declaration

```swift
nonisolated func quickLookPreview<Items>(_ selection: Binding<Items.Element?>, in items: Items) -> some View where Items : RandomAccessCollection, Items.Element == URL

```

## Parameters

- `selection`: A doc://com.apple.documentation/documentation/SwiftUI/Binding to an element that’s part of the items collection. This is the URL that you currently want to preview.
- `items`: A collection of URLs to preview.

## Return Value

Return Value A view that presents the preview of the contents of the URL.

## Discussion

Discussion The Quick Look preview appears when you set the binding to a non-nil item. When you set the item back to nil, Quick Look dismisses the preview. If the value of the selection binding isn’t contained in the items collection, Quick Look treats it the same as a nil selection. Quick Look updates the value of the selection binding to match the URL of the file the user is previewing. Upon dismissal by the user, Quick Look automatically sets the item binding to nil.

## See Also

### Previewing content

- [quickLookPreview(_:)](swiftui/view/quicklookpreview(_:).md)
