Skip to content

LennartEgb/compose-shadow

Repository files navigation

compose-shadow

shadow shadow-inset

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.

Usage

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

Installation

To use compose-shadow in your project add the github package maven repository to your root settings.gradle.kts

dependencyResolutionManagement {
    repositories {
        maven {
            url = uri("https://maven.pkg.github.com/LennartEgb/compose-shadow")
        }
    }
}

and add the dependency to the module level build.gradle.kts

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("dev.lennartegb.compose:shadow:0.1.1")
        }
    }
}

About

A lightweight compose multiplatform shadow implementation

Resources

License

Stars

Watchers

Forks

Packages