---
title: "previewContext(_:isStale:viewKind:)"
framework: activitykit
role: symbol
role_heading: Instance Method
path: "activitykit/activityattributes/previewcontext(_:isstale:viewkind:)"
---

# previewContext(_:isStale:viewKind:)

Generates a preview for a Live Activity.

## Declaration

```swift
func previewContext(_ contentState: Self.ContentState, isStale: Bool = false, viewKind: ActivityPreviewViewKind) -> some View

```

## Parameters

- `contentState`: The dynamic content of the Live Activity.
- `isStale`: A Boolean that indicates whether the content of a Live Activity is out of date.
- `viewKind`: A value that determines which Live Activity presentation to render for this preview.
