Compose Modifier

blur

Draws content blurred with the specified radii.

blur

Source set: Common
public fun Modifier.blur(
    radiusX: Dp,
    radiusY: Dp,
    edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle,
): Modifier

Draws content blurred with the specified radii.

Note this effect is only supported on Android 12 and above. Attempts to use this Modifier on older Android versions will be ignored.

Usage of this API renders the corresponding composable into a separate graphics layer. Because the blurred content renders a larger area by the blur radius, this layer is explicitly clipped to the content bounds. Introduce additional space around the drawn content by the specified blur radius to remain within the content bounds.

Parameters

radiusX radius of the blur along the x axis
radiusY radius of the blur along the y axis
edgeTreatment strategy used to render pixels outside content bounds

blur

Source set: Common
public fun Modifier.blur(
    radius: Dp,
    edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle,
): Modifier

Draws content blurred with the specified radius.

Note this effect is only supported on Android 12 and above. Attempts to use this Modifier on older Android versions will be ignored.

Usage of this API renders the corresponding composable into a separate graphics layer. Because the blurred content renders a larger area by the blur radius, this layer is explicitly clipped to the content bounds. Introduce additional space around the drawn content by the specified blur radius to remain within the content bounds.

Parameters

radius radius of the blur along both the x and y axis
edgeTreatment strategy used to render pixels outside content bounds

blur

Source set: Common
public fun Modifier.blur(
    radius: BlurRadiusSpec,
    edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle,
    alpha: Float = 1f,
): Modifier

Draws content with a blur specified by radius.

A uniform radius renders on Android 12 (API 31) and above; spatially-varying radii (gradients and custom shaders) require Android 13 (API 33) and above. Below these versions the modifier is ignored.

Usage of this API renders the corresponding composable into a separate graphics layer. Because the blurred content renders a larger area by the blur radius, this layer is explicitly clipped to the content bounds. Introduce additional space around the drawn content by the specified blur radius to remain within content bounds.

Parameters

radius varying blur radius configuration across the surface
edgeTreatment strategy used to render pixels outside content bounds
alpha opacity of the blurred content in the 0..1 range

blur

Source set: Common
public fun Modifier.blur(block: BlurScope.() -> Unit): Modifier

Draws content with a blur whose radius can vary across the surface.

When block assigns BlurScope.radius multiple times, the last assignment wins.

A uniform radius renders on Android 12 (API 31) and above; spatially-varying radii (gradients and custom shaders) require Android 13 (API 33) and above. Below these versions the modifier is ignored.

Usage of this API renders the corresponding composable into a separate graphics layer. Because the blurred content renders a larger area by the blur radius, this layer is explicitly clipped to the content bounds. Introduce additional space around the drawn content by the specified blur radius to remain within the content bounds.

Parameters

block configuration block run against BlurScope

Content updated: