Compose Multiplatform 1.9 started supporting shadows, so this library is deprecated.
A Kotlin Multiplatform implementation of drop/inner shadows for Compose Multiplatform.
This library will continue to be maintained until this is officially supported in Compose.
| compose-shadow | CMP | Kotlin | 
|---|---|---|
| 2.0.4 | 1.8.1 | 2.1.21 | 
| 2.0.3 | 1.7.3 | 2.1.10 | 
| 2.0.1 | 1.7.1 | 2.1.0 | 
| 2.0.0 | 1.7.1 | 2.0.21 | 
| 1.0.0 | 1.7.0-rc01 | 2.0.21 | 
implementation("com.adamglin:compose-shadow:$version")compose-shadow supports these platforms:
- Android (SDK > 28)
- iOS
- Desktop (JVM)
- JS/Wasm
Apply and customize shadow using the dropShadow Modifier:
Box(
    Modifier
        .dropShadow(
            shape = RectangleShape,
            color = Color.Black.copy(.5f),
            offsetX = 4.dp,
            offsetY = 4.dp,
            blur = 10.dp,
            spread = 5.dp,
        )
        .background(Color.White),
)Box(
    Modifier
        .innerShadow(
            shape = RectangleShape,
            color = Color.Black.copy(.5f),
            offsetX = 4.dp,
            offsetY = 4.dp,
            blur = 10.dp,
            spread = 5.dp,
        )
        .background(Color.White),
)We provided this address here for viewing the wasm online examples.
 
 
