Skip to content

Drop shadows

zed-alpha edited this page May 10, 2026 · 1 revision

Package: com.zedalpha.shadowgadgets.compose


As far as desired functionality, these should behave exactly like the originals, just with the content area clipped out.

The only functional differences would be bug fixes; e.g., at the time of writing this, both original dropShadow() functions fail to update if you change the shape. I mean circle to rectangle, not size changes. The library functions, conversely, handle the shape correctly.


Modifier.clippedDropShadow

The "simple" version takes a Shadow object, and will recompose with every change.

fun Modifier.clippedDropShadow(
    shape: Shape,
    shadow: Shadow
): Modifier

It is a drop-in replacement for Modifier.dropShadow.


Lambda

The lambda version allows for updating shadow properties without recomposition.

fun Modifier.clippedDropShadow(
    shape: Shape,
    block: DropShadowScope.() -> Unit
): Modifier

It is a drop-in replacement for the Modifier.dropShadow.


Examples

An example of the lambda version can be found in ComposeDropTopic.kt.

Clone this wiki locally