androidx.compose.ui.draw

blur

Function · from org.jetbrains.compose.ui:ui:1.12.2

No hand-written docs yet.

Draw 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.

With radiusX, radiusY

fun Modifier.blur(
    radiusX: Dp,
    radiusY: Dp,
    edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle,
): Modifier

radiusX: DpRequired

Radius of the blur along the x axis

radiusY: DpRequired

Radius of the blur along the y axis

edgeTreatment: BlurredEdgeTreatmentOptional

Default: BlurredEdgeTreatment.Rectangle

Strategy used to render pixels outside of bounds of the original input

With radius

fun Modifier.blur(
    radius: Dp,
    edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle,
): Modifier

radius: DpRequired

Radius of the blur along both the x and y axis

Same as above: edgeTreatment.

Library docs

Draw 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. It is recommended introduce additional space around the drawn content by the specified blur radius to remain within the content bounds.