<!--
{
  "availability" : [
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WidgetKit",
  "identifier" : "/documentation/WidgetKit/Preview(_:widget:relevanceEntries:)",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "WidgetKit"
    ],
    "preciseIdentifier" : "s:9WidgetKit7Preview_6widget16relevanceEntriesySSSg_xyScMYccSayq_GyYaScMYcctc7SwiftUI0A0RzAA14RelevanceEntryR_r0_lufm"
  },
  "title" : "Preview(_:widget:relevanceEntries:)"
}
-->

# Preview(_:widget:relevanceEntries:)

Preview a relevance configuration widget.

```
@freestanding(declaration) macro Preview<Widget, Entry>(_ name: String? = nil, widget: @escaping @MainActor () -> Widget, @PreviewRelevanceEntryBuilder<Entry> relevanceEntries: @escaping @MainActor () async -> [Entry]) where Widget : Widget, Entry : RelevanceEntry
```

## Parameters

`name`

An optional display name for the preview that appears in the Xcode preview canvas.

`widget`

A closure producing the widget to be previewed.

`relevanceEntries`

A closure building the entries to be previewed.

## Overview

Provide the preview with sample data and use it to step through the timeline while ignoring the dates of the entries, and test out the transitions between them.

> Note: The relevance entries must be of the type that the widget expects.

---

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)