
Draw CSS-style box and inner shadows via a single modifier API—supports blur, spread, offset, color, shape masking, clipping, and inset shadows for Figma-like results.
A compose multiplatform library to support drawing css style box-shadows. The reason for this library is to replicate drop shadows and inner shadows from Figma.
This library contains a single modifier with a simple API. The composable at the top could be created like this:
Box(
modifier = Modifier
.size(40.dp)
.boxShadow(
blurRadius = 20.dp,
spreadRadius = 0.dp,
offset = DpOffset(0.dp, 0.dp),
color = Color.Magenta,
shape = CircleShape,
clip = true,
inset = true,
)
.background(Color.Blue)
)To use compose-shadow in your project add Maven Central to your root settings.gradle.kts
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}and add the dependency to the module level build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.vickyleu.kmp.shadow:compose-shadow:2.0.0")
}
}
}A compose multiplatform library to support drawing css style box-shadows. The reason for this library is to replicate drop shadows and inner shadows from Figma.
This library contains a single modifier with a simple API. The composable at the top could be created like this:
Box(
modifier = Modifier
.size(40.dp)
.boxShadow(
blurRadius = 20.dp,
spreadRadius = 0.dp,
offset = DpOffset(0.dp, 0.dp),
color = Color.Magenta,
shape = CircleShape,
clip = true,
inset = true,
)
.background(Color.Blue)
)To use compose-shadow in your project add Maven Central to your root settings.gradle.kts
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}and add the dependency to the module level build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.vickyleu.kmp.shadow:compose-shadow:2.0.0")
}
}
}