2025-07-18 10:40:29 +08:00
2025-07-04 13:59:56 +08:00
2025-07-18 10:32:49 +08:00
2025-06-22 14:56:05 +08:00
2025-07-18 10:06:41 +08:00
2025-06-18 18:15:41 +08:00
2025-07-18 10:23:37 +08:00
2025-07-18 10:06:41 +08:00
2025-07-18 10:06:41 +08:00
2025-06-18 18:15:41 +08:00
2025-07-18 10:40:29 +08:00

Liquid Glass

Apple's Liquid Glass effect for Android Jetpack Compose.

Check the demo app, Android 13 and above is required.

Library

The library is in alpha stage, every API may be changed, use it on your own risk.

Add to project

JitPack Release

// settings.gradle.kts in root project
dependencyResolutionManagement {
    repositories {
        maven("https://jitpack.io")
    }
}

// build.gradle.kts in module
implementation("com.github.Kyant0:AndroidLiquidGlass:<version>")

Examples

val providerState = rememberLiquidGlassProviderState(
    backgroundColor = Color.White
)

// content behind the glass
Box(Modifier.liquidGlassProvider(providerState))

// glass
Box(
    Modifier.liquidGlass(
        providerState,
        LiquidGlassStyle(
            shape = CornerShape.large,
            innerRefraction = InnerRefraction(
                height = RefractionValue(8.dp),
                amount = RefractionValue.Full
            ),
            material = GlassMaterial(
                blurRadius = 8.dp,
                whitePoint = 0.1f,
                chromaMultiplier = 1.5f
            )
        )
    )
)

Limitations

The following case is not supported:

LiquidGlassProvider(providerState) {
    LiquidGlass(providerState) {}
}

Instead, you should rewrite it like this:

Box {
    LiquidGlassProvider(providerState) {}
    LiquidGlass(providerState) {}
}

Glass parameters

Parameter Availability Verification
Inner refraction height ✔️ ✔️
Inner refraction amount ✔️ ✔️
Outer refraction height ❌ ❌
Outer refraction amount ❌ ❌
Bleed amount ✔️ ❌
Bleed blur radius ✔️ -
Bleed opacity ✔️ ❌
Blur radius ✔️ -

Other extensions:

  • Border color, width, angle, decay
  • Contrast, white point, chroma multiplier
  • Eccentric factor
  • Dispersion height (🚧)

Comparisons

Android device: Google Pixel 4 XL (the smallest width is adjusted to 440 dp to match the density of the iOS device)

iOS device: iPhone 16 Pro Max (simulator)

Test glass area size: 300 x 300, corner radius: 30

iOS Android

Complete comparisons:

Special thanks

Star history

Star history chart

S
Description
Compose Multiplatform Liquid Glass effect
Readme
233 MiB
0 Stars 1 Watchers 0 Forks
Languages
Kotlin 94.6%
DM 5.1%
Swift 0.3%