---
title: "Scrim"
description: "A Scrim that obscures content behind a modal surface."
type: "component"
---

<div class='type'>Composable Component</div>



A Scrim that obscures content behind a modal surface.

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

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


```kotlin
@Composable
fun Scrim(
    contentDescription: String?,
    modifier: Modifier = Modifier,
    onClick: (() -> Unit)? = {},
    alpha: () -> Float = { 1f },
    color: Color = ScrimDefaults.color,
)
```


#### Parameters

| | |
| --- | --- |
| contentDescription | text used by accessibility services to describe what this Scrim can dismiss. This should always be provided unless the scrim is used for decorative purposes and `onClick` is null. |
| modifier | Optional `Modifier` for the scrim. |
| onClick | Optional callback invoked when the user clicks on the scrim, if set to null, no click semantics are provided. |
| alpha | Opacity to be applied to the `color` from 0.0f to 1.0f representing fully transparent to fully opaque respectively. This is always coerced between 0.0f and 1.0f. |
| color | The color of the scrim. This color must not be `Color.Unspecified` for this scrim to be drawn. |






