Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 1.91 KB

README.md

File metadata and controls

76 lines (59 loc) · 1.91 KB

Compose Shadow

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.

Maven Central Version


Versions

compose-shadow CMP Kotlin
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

Installation

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

Platform support

compose-shadow supports these platforms:

  1. Android (SDK > 28)
  2. iOS
  3. Desktop (JVM)
  4. JS/Wasm

Usage

Apply and customize shadow using the dropShadow Modifier:

Drop Shadow

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),
)

Inner Shadow

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),
)

Sample

We provided this address here for viewing the wasm online examples.

Screenshots

image image image