# StyleLayerScope

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/StyleLayerScope.kt+class:androidx.compose.foundation.style.StyleLayerScope) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  interface StyleLayerScope
  ```
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`. |

*** ** * ** ***

Introduces the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope#styleLayer(kotlin.Function0)` method that allows styles to create a style property layer.

This is a separate interface to allow a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CustomStyle` type to decide if `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope#styleLayer(kotlin.Function0)` is available directly in a style.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope#styleLayer(kotlin.Function0)(block: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Raise the layer of properties that are set in `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope#styleLayer(kotlin.Function0)`. | Cmn |

## Public functions

### styleLayer

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

```
fun styleLayer(block: () -> Unit): Unit
```

Raise the layer of properties that are set in `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope#styleLayer(kotlin.Function0)`. Properties set in a layer will take precedence over properties set in the layers below it. A layer is implied by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleStateScope#state(androidx.compose.foundation.style.StyleStateKey,kotlin.Function0,kotlin.Function2)`, or helpers that use it, such as `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StyleStateScope).pressed(kotlin.Function0)` and `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StyleStateScope).focused(kotlin.Function0)`.

The last property set with the greatest style layer is the resolved value of a style property.