<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/CardSnippetContext",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:19_AppIntents_SwiftUI18CardSnippetContextV"
  },
  "title" : "CardSnippetContext"
}
-->

# CardSnippetContext

A type that stores information about how to render a card snippet.

```
struct CardSnippetContext
```

## Overview

The `CardSnippetContext` type stores information that you use to render the views of a card snippet.
When you create a `CardSnippet` for your entity, you specify a closure that accepts an instance of this
type as a parameter. When the system needs to render a specific instance of your entity type, it passes
the entity and a `CardSnippetContext` object to your closure. The context object contains information
about the rendering environment, and you use this information to adjust your view-creation code.

The `CardSnippetContext` type contains only information that’s specific to card snippets. During rendering,
use SwiftUI environment values to adjust your rendering code. For example, you might retrieve
the current color scheme and locale from the <doc://com.apple.documentation/documentation/SwiftUI/EnvironmentValues/colorScheme>
and <doc://com.apple.documentation/documentation/SwiftUI/EnvironmentValues/locale> environment values.
For more information about how to use SwiftUI environment values, see
<doc://com.apple.documentation/documentation/SwiftUI/EnvironmentValues>.

## Topics

### Getting the environment details

[`var family: CardSnippetFamily`](/documentation/AppIntents/CardSnippetContext/family)

The environment with which to configure your views.

## Relationships

### Conforms To

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

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

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

---

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)