---
title: "HostDefaultProvider"
description: "An interface that allows the hosting environment (e.g., Android, Desktop, or iOS) to provide
default values for [CompositionLocal] using [compositionLocalWithHostDefaultOf].

This acts as a decoupling layer, allowing platform-agnostic libraries to request
platform-specific components ((like `LifecycleOwner` or `ViewModelStoreOwner`) without depending
on platform-specific APIs or artifacts."
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
public interface HostDefaultProvider
```


An interface that allows the hosting environment (e.g., Android, Desktop, or iOS) to provide
default values for `CompositionLocal` using `compositionLocalWithHostDefaultOf`.

This acts as a decoupling layer, allowing platform-agnostic libraries to request
platform-specific components ((like `LifecycleOwner` or `ViewModelStoreOwner`) without depending
on platform-specific APIs or artifacts.


## Functions

```kotlin
public fun <T> getHostDefault(key: HostDefaultKey<T>): T
```


Retrieves a value associated with `key` from the host environment.



