by @alexstyl
✉️ Leave your feedback

← Back to Compose UI

drawShadow

Modifier
in
Compose UI
. Since 0.1.0-dev15

Overview

Examples

Community Notes

Creates a GraphicsLayerModifier that draws the shadow. The elevation defines the visual depth of the physical object. The physical object has a shape specified by shape.

Note that elevation is only affecting the shadow size and doesn't change the drawing order. Use zIndex modifier if you want to draw the elements with larger elevation after all the elements with a smaller one.

Overloads

drawShadow

@Deprecated(
    "Use shadow instead",
    ReplaceWith(
        "shadow(elevation, shape, clip)", "androidx.compose.ui.draw"
    )
)
fun Modifier.drawShadow(
    elevation: Dp,
    shape: Shape = RectangleShape,
    clip: Boolean = elevation > 0.dp
)

Parameters

NameDescription
elevationThe elevation for the shadow in pixels
shapeDefines a shape of the physical object
clipWhen active, the content drawing clips to the shape
Next ComponentAndroidView