---
title: TimelineProviderContext.EnvironmentVariants
framework: widgetkit
role: symbol
role_heading: Structure
path: widgetkit/timelineprovidercontext/environmentvariants-swift.struct
---

# TimelineProviderContext.EnvironmentVariants

A structure containing all varieties of environments where a widget could appear.

## Declaration

```swift
@dynamicMemberLookup struct EnvironmentVariants
```

## Overview

Overview When changes occur in environment values that affect display, like colorScheme, WidgetKit renders your widget’s views. If your widget uses assets that take time to generate or depend on the specific environment they’re rendered in, you can generate those assets in advance based on the new environment values. For example, in macOS, if the user has a mixture of @1x and @2x displays, the value for displayScale includes both scales. With these values, you can prepare your content in advance, if needed, to handle either type of display.

## Topics

### Subscripts

- [subscript(_:)](widgetkit/timelineprovidercontext/environmentvariants-swift.struct/subscript(_:).md)
- [subscript(dynamicMember:)](widgetkit/timelineprovidercontext/environmentvariants-swift.struct/subscript(dynamicmember:).md)

## See Also

### Accessing Environment Variations

- [environmentVariants](widgetkit/timelineprovidercontext/environmentvariants-swift.property.md)
