---
title: CardSnippetContext
framework: appintents
role: symbol
role_heading: Structure
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+, watchOS 27.0+]
path: appintents/cardsnippetcontext
---

# CardSnippetContext

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

## Declaration

```swift
struct CardSnippetContext
```

## Overview

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 colorScheme and locale environment values. For more information about how to use SwiftUI environment values, see EnvironmentValues.

## Topics

### Getting the environment details

- [family](appintents/cardsnippetcontext/family.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Card snippets

- [SnippetRepresentableEntity](appintents/snippetrepresentableentity.md)
- [CardSnippet](appintents/cardsnippet.md)
- [CardSnippetFamily](appintents/cardsnippetfamily.md)
- [EntitySnippetContent](appintents/entitysnippetcontent.md)
- [EntitySnippetContentBuilder](appintents/entitysnippetcontentbuilder.md)
- [CardSnippetSize](appintents/cardsnippetsize.md)
