<!--
{
  "availability" : [
    "iOS: 27.3.0 -",
    "iPadOS: 27.3.0 -",
    "macCatalyst: -",
    "macOS: 27.3.0 -",
    "tvOS: 27.3.0 -",
    "visionOS: 27.3.0 -",
    "watchOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/SnippetRepresentableEntity",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents26SnippetRepresentableEntityP"
  },
  "title" : "SnippetRepresentableEntity"
}
-->

# SnippetRepresentableEntity

An app entity that provides a visual representation for its content.

```
protocol SnippetRepresentableEntity : AppEntity
```

## Overview

Adopt the `SnippetRepresentableEntity` protocol in your app entity when you want to provide a visual
representation of its content. This protocol conforms to the base [`AppEntity`](/documentation/AppIntents/AppEntity) protocol and adds a
[`snippet`](/documentation/AppIntents/SnippetRepresentableEntity/snippet) property for delivering a snippet type to display
your entity’s content. When the system needs to show information about your entity, it displays the
contents of your snippet. For example, Siri might show the snippet during a conversation to confirm
a choice or display details about a requested item.

Implement the [`snippet`](/documentation/AppIntents/SnippetRepresentableEntity/snippet) property in your entity type and return a snippet
with the SwiftUI view you want the system to display. In the following example, the property returns
a [`CardSnippet`](/documentation/AppIntents/CardSnippet) type, which delivers the custom `MessageSnipperCard` view from the app. This view
uses the provided message object to configure the views it displays.

```swift
extension MessageEntity: SnippetRepresentableEntity {
    static var snippet: some EntitySnippetContent<MessageEntity> {
        CardSnippet(supportedFamilies: [.standard]) { message, _ in
            // Prepare any extra data before returning the view.
            MessageSnippetCard(message: message)
        }
    }
}
```

When you build the content for your snippet, create views with primarily static content such as text and
images. The system renders snippets in advance and stores your views in a static archive it can use at
any time, including when your app isn’t running. Because rendering happens in advance, you can’t change
the content of your view dynamically later. If your view requires data that isn’t immediately available
in your entity, prepare the data before returning the SwiftUI view from your snippet. For example, if you need
to create custom images, create them before you return your view.
Prepare data synchronously to ensure it’s available when you create your view. If you generate data
asynchronously, it likely won’t be available in time.

To include interactive controls in your view, add a SwiftUI control that runs an app intent.
For example, you can initialize a <doc://com.apple.documentation/documentation/SwiftUI/Button> or
<doc://com.apple.documentation/documentation/SwiftUI/Toggle> view with an app intent. When someone interacts
with one of your controls, the system runs the specified app intent. After your app intent runs, the system
generates a new SwiftUI view archive for your snippet, incorporating any changes you made to your views
because of the app intent.

## Topics

### Configuring the snippet

[`static var snippet: Self.Body`](/documentation/AppIntents/SnippetRepresentableEntity/snippet)

The snippet that contains the view to display.

[`associatedtype Body : EntitySnippetContent`](/documentation/AppIntents/SnippetRepresentableEntity/Body)

## Relationships

### Inherits From

[`CustomLocalizedStringResourceConvertible`](/documentation/Foundation/CustomLocalizedStringResourceConvertible)

[`InstanceDisplayRepresentable`](/documentation/AppIntents/InstanceDisplayRepresentable)

[`Identifiable`](/documentation/Swift/Identifiable)

[`DisplayRepresentable`](/documentation/AppIntents/DisplayRepresentable)

[`PersistentlyIdentifiable`](/documentation/AppIntents/PersistentlyIdentifiable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`TypeDisplayRepresentable`](/documentation/AppIntents/TypeDisplayRepresentable)

[`AppEntity`](/documentation/AppIntents/AppEntity)

[`Sendable`](/documentation/Swift/Sendable)

[`AppValue`](/documentation/AppIntents/AppValue)

---

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)