# NestedStyleProviderStyleScope

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/NestedStyles.kt+class:androidx.compose.foundation.style.NestedStyleProviderStyleScope) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  interface NestedStyleProviderStyleScope
  ```
Known direct subclasses [CommonStyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyleScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyleScope` | A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyleScope` is the scope used by a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyle`. |

*** ** * ** ***

A scope that allows providing a nested style that will be read and used by a nested styleable composable function.

`https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope` is implemented by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyleScope`, but a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CustomStyle` may choose to prevent arbitrary keys from being provided by defining a style scope that excludes this interface.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)(key: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleKey, style: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyle)` Provides `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)` as a nested style to the nested composable identified by the provided `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)`. | Cmn |

## Public functions

### provideNestedStyle

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01)

```
fun provideNestedStyle(key: NestedStyleKey, style: CommonStyle): Unit
```

Provides `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)` as a nested style to the nested composable identified by the provided `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)`. The `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)` is intended to be applied as the style for a nested styleable composable using `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleConsumerStyleScope#applyNestedStyle(androidx.compose.foundation.style.NestedStyleKey)`.

| Parameters |
|---|---|
| `key: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleKey` | the key that identifies which nested composable this style is applied to |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyle` | the style to be applied to the nested composable |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleConsumerStyleScope#applyNestedStyle(androidx.compose.foundation.style.NestedStyleKey)` |   |