{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ProvidableCompositionLocal

kotlin.Any
   ↳ androidx.compose.runtime.CompositionLocal
     ↳ androidx.compose.runtime.ProvidableCompositionLocal

A ProvidableCompositionLocal can be used in CompositionLocalProvider to provide values.

See also
compositionLocalOf
staticCompositionLocalOf
CompositionLocal
CompositionLocalProvider

Summary

Public functions

infix ProvidedValue<T>
provides(value: T)

Associates a CompositionLocal key to a value in a call to CompositionLocalProvider.

Cmn
infix ProvidedValue<T>
providesDefault(value: T)

Associates a CompositionLocal key to a value in a call to CompositionLocalProvider if the key does not already have an associated value.

Cmn

Inherited properties

From androidx.compose.runtime.CompositionLocal
T

Return the value provided by the nearest CompositionLocalProvider component that invokes, directly or indirectly, the composable function that uses this property.

Cmn

Public functions

provides

infix fun provides(value: T): ProvidedValue<T>

Associates a CompositionLocal key to a value in a call to CompositionLocalProvider.

providesDefault

infix fun providesDefault(value: T): ProvidedValue<T>

Associates a CompositionLocal key to a value in a call to CompositionLocalProvider if the key does not already have an associated value.