---
title: "subscript(dynamicMember:)"
framework: swiftui
role: symbol
role_heading: Instance Subscript
path: "swiftui/presentationdetent/context/subscript(dynamicmember:)"
---

# subscript(dynamicMember:)

Returns the value specified by the keyPath from the environment.

## Declaration

```swift
subscript<T>(dynamicMember keyPath: KeyPath<EnvironmentValues, T>) -> T { get }
```

## Overview

Overview This uses the environment from where the sheet is shown, not the environment where the presentation modifier is applied.
