adamglin0 / compose-shadow

a kotlin library for draw shadow in compose multiplatform
22 stars 1 forks source link

Compose Shadow

a kotlin platform library for show drop shadow in compose. This library will continue to be actively updated until the official implementation of a complete shadow in Compose.

Maven Central Version


Version

compose-shadow cmp kotlin
1.0.0 1.7.0-rc01 2.0.21
0.0.1 1.7.0-dev1743 2.0.0

Install

implementation("com.adamglin:compose-shadow:$version")

Support

compose-shadow supports platforms below.

  1. [x] android > 28
  2. [x] ios
  3. [x] desktop(jvm)

Using

add dropShadow by Modifier.

Box(
    Modifier
        .size(50.dp)
        .dropShadow(
            shape = RectangleShape,
            color = Color.Black.copy(.5f),
            offsetX = 4.dp,
            offsetY = 4.dp,
            blur = 10.dp,
            spread = 5.dp,
        )
        .background(Color.White),
)
image image image