Scrim

Functions summary

Unit
@Composable
Scrim(
    contentDescription: String?,
    modifier: Modifier,
    onClick: (() -> Unit)?,
    alpha: () -> Float,
    color: Color
)

A Scrim that obscures content behind a modal surface.

Cmn

Functions

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

A Scrim that obscures content behind a modal surface.

Parameters
contentDescription: String?

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: Modifier = Modifier

Optional Modifier for the scrim.

onClick: (() -> Unit)? = {}

Optional callback invoked when the user clicks on the scrim, if set to null, no click semantics are provided.

alpha: () -> Float = { 1f }

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: Color = ScrimDefaults.color

The color of the scrim. This color must not be Color.Unspecified for this scrim to be drawn.