# HostDefaultKey

Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/HostDefaultKey.kt+class:androidx.compose.runtime.HostDefaultKey) Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.11.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  interface HostDefaultKey<T : Any?>
  ```
Known direct subclasses [ViewTreeHostDefaultKey](https://developer.android.com/reference/kotlin/androidx/compose/runtime/ViewTreeHostDefaultKey)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ViewTreeHostDefaultKey` | An Android-specific `https://developer.android.com/reference/kotlin/androidx/compose/runtime/HostDefaultKey` that identifies values stored within the `https://developer.android.com/reference/android/view/View.html` hierarchy using Resource ID tags. |

*** ** * ** ***

A type-safe identifier used to define a key for retrieving default values from the hosting environment.

This key is strictly required by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#compositionLocalWithHostDefaultOf(androidx.compose.runtime.HostDefaultKey)` to establish a mapping between a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal` and a value provided by the host (via the internal `https://developer.android.com/reference/kotlin/androidx/compose/runtime/HostDefaultProvider`).

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | The type of the value associated with this key. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#compositionLocalWithHostDefaultOf(androidx.compose.runtime.HostDefaultKey)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/HostDefaultProvider` |   |