Skip to content
Back to search

kmp-liquid-glass-marketplace

MarketplaceWorks with Claude CodeGitHub

A library to create liquid glass components in Compose multiplatform

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/kashif-e--kmpliquidglass/badge.svg)](/listings/kashif-e--kmpliquidglass)

HTML

<a href="/listings/kashif-e--kmpliquidglass"><img src="/api/listings/kashif-e--kmpliquidglass/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

commonMain.dependencies {
    implementation("io.github.kashif-mehmood-km:backdrop:0.0.1-alpha02")
}

For version catalog:

[libraries]
backdrop = { module = "io.github.kashif-mehmood-km:backdrop", version = "0.0.1-alpha02" }

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 24 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "kmp-liquid-glass-marketplace",
  3. "owner": {
  4. "name": "Kashif-E",
  5. "email": "kashif.mehmood@packagex.io",
  6. "url": "https://github.com/Kashif-E"
  7. },
  8. "metadata": {
  9. "description": "Marketplace for the KMP Liquid Glass library — Compose Multiplatform skills.",
  10. "version": "1.0.0"
  11. },
  12. "plugins": [
  13. {
  14. "name": "kmp-liquid-glass",
  15. "source": "./plugins/kmp-liquid-glass",
  16. "description": "Build iOS-style liquid glass / frosted glass UI components in Compose Multiplatform using the io.github.kashif-mehmood-km:backdrop library. Provides recipes for cards, buttons, dialogs, tab bars, toggles, magnifiers, progressive blur, SDF shaders, and more — across Android, iOS, Desktop, and Web.",
  17. "category": "ui",
  18. "tags": ["compose-multiplatform", "kmp", "liquid-glass", "frosted-glass", "ios", "ui-components"],
  19. "homepage": "https://github.com/Kashif-E/KMPLiquidGlass",
  20. "repository": "https://github.com/Kashif-E/KMPLiquidGlass",
  21. "license": "Apache-2.0"
  22. }
  23. ]
  24. }
README.md · README · 370 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # KMP Liquid Glass
  2. A liquid glass effect library for Compose Multiplatform.
  3. [![Maven Central](https://img.shields.io/maven-central/v/io.github.kashif-mehmood-km/backdrop)](https://central.sonatype.com/artifact/io.github.kashif-mehmood-km/backdrop)
  4. > Based on [AndroidLiquidGlass](https://github.com/Kyant0/AndroidLiquidGlass) by Kyant.
  5. ![Banner](artworks/liquid_glass_kmp.png)
  6. ## Overview
  7. KMP Liquid Glass lets you create frosted glass UI effects in Compose Multiplatform. The library provides blur, refraction, highlights, and shadow effects that work across Android, iOS, Desktop, and Web.
  8. **Key capabilities:**
  9. - **Blur effects** — Gaussian blur with configurable radius and edge treatment
  10. - **Color adjustments** — Brightness, contrast, saturation, and vibrancy controls
  11. - **Lens refraction** — Glass-like distortion with optional chromatic aberration
  12. - **Dynamic highlights** — Ambient and directional lighting that responds to angle
  13. - **Shadows** — Drop shadows and inner shadows for depth
  14. - **Progressive blur** — Gradient blur for scroll containers
  15. ## Installation
  16. ```kotlin
  17. commonMain.dependencies {
  18. implementation("io.github.kashif-mehmood-km:backdrop:0.0.1-alpha02")
  19. }
  20. ```
  21. For version catalog:
  22. ```toml
  23. [libraries]
  24. backdrop = { module = "io.github.kashif-mehmood-km:backdrop", version = "0.0.1-alpha02" }
  25. ```
  26. ## Use with Claude Code
  27. This repo is also a [Claude Code](https://claude.com/claude-code) plugin marketplace. Installing the `kmp-liquid-glass` skill teaches Claude (and any agent on Claude Code) the library's mental model, the full effect / component / shader API, and a curated set of recipes — so prompts like *"add a frosted glass tab bar"* or *"make this card iOS-style translucent"* produce correct, idiomatic code on the first try.
  28. ### Install
  29. In any Claude Code session, run:
  30. ```text
  31. /plugin marketplace add Kashif-E/KMPLiquidGlass
  32. /plugin install kmp-liquid-glass@kmp-liquid-glass-marketplace
  33. ```
  34. Then reload plugins (or restart the session):
  35. ```text
  36. /reload-plugins
  37. ```
  38. ### Verify
  39. Ask Claude something the skill should handle, for example:
  40. > Build a glass-style settings dialog using the `backdrop` library — title "Notifications", two toggle rows, Cancel/Save buttons. Heavy frosted look like an iOS alert.
  41. Claude should invoke the `kmp-liquid-glass` skill (you'll see it announce "Using kmp-liquid-glass …") and produce code that uses real APIs from `com.kashif_e.backdrop.*` with the correct effect ordering, dim placement, and z-order.
  42. > **Tip:** the skill is much more reliable when you mention the library by name in your prompt — say "use the backdrop library" or "iOS liquid glass" rather than just "make it glassy". Claude Code currently under-triggers skills for purely visual descriptions.
  43. ### What's included
  44. The plugin ships a single skill — [`kmp-liquid-glass`](plugins/kmp-liquid-glass/skills/kmp-liquid-glass/SKILL.md) — with progressive references:
  45. - **`SKILL.md`** — mental model, decision tree, effect ordering rules, 12 pitfalls
  46. - **`references/effects.md`** — every effect with parameter ranges and recipes
  47. - **`references/components.md`** — full recipes for card, button, dialog, toggle, tab bar, search, FAB, sheet handle, sticky list header, scroll container with progressive blur
  48. - **`references/advanced.md`** — SDF shaders, magnifier (combined backdrops), custom `expect`/`actual` shaders, performance tuning
  49. - **`references/platform.md`** — exact API-level behavior matrix per effect, per platform
  50. ### Using the skill from other agents
  51. The skill files are plain Markdown, so any agent that reads filesystem skills (Claude Agent SDK, custom harnesses, IDE extensions) can load `plugins/kmp-liquid-glass/skills/kmp-liquid-glass/SKILL.md` directly without going through the Claude Code marketplace.
  52. ## How it works
  53. The library uses a two-layer approach:
  54. 1. **Backdrop layer** — The content you want to show through the glass (usually an image or gradient)
  55. 2. **Glass layer** — The element that samples and applies effects to the backdrop
  56. The backdrop captures its content into a graphics layer. When you draw a glass element, it samples from this captured content and applies your chosen effects.
  57. ## Basic usage
  58. ### Step 1: Create a backdrop
  59. Use `rememberLayerBackdrop()` to create a backdrop, then apply it to your background content with the `layerBackdrop` modifier:
  60. ```kotlin
  61. val backdrop = rememberLayerBackdrop()
  62. Image(
  63. painter = painterResource(Res.drawable.wallpaper),
  64. modifier = Modifier.layerBackdrop(backdrop).fillMaxSize()
  65. )
  66. ```
  67. ### Step 2: Draw glass elements
  68. Use `drawBackdrop` to create glass elements that sample from the backdrop:
  69. ```kotlin
  70. Box(
  71. modifier = Modifier
  72. .drawBackdrop(
  73. backdrop = backdrop,
  74. shape = { RoundedCornerShape(24.dp) },
  75. effects = {
  76. blur(16.dp.toPx())
  77. }
  78. )
  79. .size(200.dp)
  80. )
  81. ```
  82. The `effects` block is where you define what the glass looks like. You can chain multiple effects together.
  83. ## Effects reference
  84. All effects are applied inside the `effects` block of `drawBackdrop`.
  85. ### blur
  86. Applies Gaussian blur to the sampled content.
  87. ```kotlin
  88. effects = {
  89. blur(radius = 16.dp.toPx())
  90. }
  91. ```
  92. | Parameter | Type | Description |
  93. |-----------|------|-------------|
  94. | `radius` | Float | Blur radius in pixels |
  95. | `edgeTreatment` | TileMode | How to handle edges (default: Clamp) |
  96. ### colorControls
  97. Adjusts brightness, contrast, and saturation.
  98. ```kotlin
  99. effects = {
  100. colorControls(
  101. brightness = 0.1f, // -1.0 to 1.0
  102. contrast = 1.2f, // 0.0 to 2.0
  103. saturation = 1.5f // 0.0 to 2.0
  104. )
  105. }
  106. ```
  107. ### vibrancy
  108. Applies an iOS-style vibrancy effect that enhances colors.
  109. ```kotlin
  110. effects = {
  111. vibrancy()
  112. }
  113. ```
  114. ### lens
  115. Creates glass refraction — the "liquid" part of liquid glass. Objects behind the glass appear distorted.
  116. ```kotlin
  117. effects = {
  118. lens(
  119. refractionHeight = 24.dp.toPx(),
  120. refractionAmount = 32.dp.toPx(),
  121. chromaticAberration = true // RGB color separation
  122. )
  123. }
  124. ```
  125. ### opacity
  126. Sets the alpha transparency of the effect.
  127. ```kotlin
  128. effects = {
  129. opacity(alpha = 0.8f)
  130. }
  131. ```
  132. ### SDF shader
  133. Applies advanced glass texture effects using a Signed Distance Field (SDF) texture. Creates realistic glass refraction with bevel lighting for 3D appearance.
  134. ```kotlin
  135. val sdfBitmap = imageResource(Res.drawable.sdf_texture)
  136. val sdfShader = rememberSdfShader(sdfBitmap)
  137. Modifier.drawPlainBackdrop(
  138. backdrop = backdrop,
  139. shape = { RoundedCornerShape(50.dp) },
  140. effects = {
  141. blur(2.dp.toPx())
  142. with(sdfShader) {
  143. apply(
  144. refractionHeight = 48.dp.toPx(), // Refraction intensity
  145. lightAngle = 45f // Light direction in degrees
  146. )
  147. }
  148. }
  149. )
  150. ```
  151. The SDF texture encodes:
  152. - **R channel:** Distance to nearest edge
  153. - **GB channels:** Surface normals for refraction direction
  154. - **A channel:** Alpha mask
  155. | Parameter | Type | Default | Description |
  156. |-----------|------|---------|-------------|
  157. | `refractionHeight` | Float | 48.dp | Height/intensity of refraction effect |
  158. | `lightAngle` | Float | 45° | Angle of light source for bevel highlights |
  159. ## Highlights and shadows
  160. Beyond effects, you can add highlights and shadows for depth:
  161. ```kotlin
  162. Modifier.drawBackdrop(
  163. backdrop = backdrop,
  164. shape = { RoundedCornerShape(24.dp) },
  165. effects = { blur(16.dp.toPx()) },
  166. highlight = { Highlight.Ambient },
  167. shadow = { Shadow(radius = 8.dp) },
  168. innerShadow = { InnerShadow(radius = 4.dp) }
  169. )
  170. ```
  171. **Highlight styles:**
  172. - `Highlight.Plain` — Simple white overlay
  173. - `Highlight.Ambient` — Soft ambient glow
  174. - `Highlight.Default(angle)` — Directional highlight based on light angle
  175. ## Plain vs full backdrop
  176. The library offers two modifiers:
  177. - **`drawBackdrop`** — Full-featured with highlights, shadows, and surface drawing
  178. - **`drawPlainBackdrop`** — Lighter version with just effects and basic drawing
  179. Use `drawPlainBackdrop` when you don't need highlights or shadows:
  180. ```kotlin
  181. Modifier.drawPlainBackdrop(
  182. backdrop = backdrop,
  183. shape = { RoundedCornerShape(16.dp) },
  184. effects = {
  185. blur(8.dp.toPx())
  186. colorControls(saturation = 1.2f)
  187. }
  188. )
  189. ```
  190. ## Platform support
  191. | Platform | Support | Rendering |
  192. |----------|---------|-----------|
  193. | Android | Full | Native RenderEffect (API 31+) / AGSL shaders (API 33+) |
  194. | Desktop | Full | Skia |
  195. | iOS | Full | Skia |
  196. | Web | Full | Skia |
  197. On Android below API 31, effects gracefully degrade.
  198. ## Runtime shaders
  199. The library uses platform-specific shader implementations for advanced effects like vibrancy and lens refraction.
  200. **Android (API 33+):** Uses AGSL (Android Graphics Shading Language), a variant of GLSL that runs on the GPU via `RuntimeShader` and `RenderEffect`.
  201. **iOS, Desktop, Web:** Uses SkSL (Skia Shading Language) via Skia's `RuntimeEffect` and `ImageFilter`.
  202. Both implementations produce visually equivalent results. The library abstracts these differences — you write the same Compose code and the correct shader runs on each platform.
  203. ### Custom shaders
  204. For advanced use cases, you can create platform-specific shaders using `expect`/`actual` declarations:
  205. ```kotlin
  206. // commonMain
  207. expect class CustomShader {
  208. fun apply(scope: BackdropEffectScope)
  209. }
  210. // androidMain — AGSL
  211. actual class CustomShader {
  212. private val shader = RuntimeShader(agslCode)
  213. actual fun apply(scope: BackdropEffectScope) {
  214. scope.setRenderEffect(RenderEffect.createRuntimeShaderEffect(shader, "content"))
  215. }
  216. }
  217. // skiaMain — SkSL
  218. actual class CustomShader {
  219. private val effect = RuntimeEffect.makeForShader(skslCode)
  220. actual fun apply(scope: BackdropEffectScope) {
  221. scope.setImageFilter(ImageFilter.makeRuntimeShader(effect, ...))
  222. }
  223. }
  224. ```
  225. ### API level requirements
  226. | Feature | Android | Skia platforms |
  227. |---------|---------|----------------|
  228. | Basic blur | API 31+ | All |
  229. | Color controls | API 31+ | All |
  230. | Vibrancy | API 33+ | All |
  231. | Lens refraction | API 33+ | All |
  232. | Custom shaders | API 33+ | All |
  233. ## Running the demos
  234. The repository includes a catalog app demonstrating all features:
  235. ```bash
  236. # Desktop
  237. ./gradlew :catalog:desktopApp:run
  238. # Android
  239. ./gradlew :catalog:androidApp:installDebug
  240. # Web
  241. ./gradlew :catalog:webApp:wasmJsBrowserRun
  242. ```
  243. For iOS, open `catalog/iosApp/iosApp.xcodeproj` in Xcode.
  244. ## Project structure
  245. ```text
  246. backdrop/ Core library (published to Maven Central)
  247. ├── commonMain/ Shared code
  248. ├── androidMain/ Android implementation
  249. └── skiaMain/ iOS, Desktop, Web implementation
  250. catalog/ Demo application
  251. ├── sharedUI/ Shared UI components
  252. ├── androidApp/ Android demo
  253. ├── desktopApp/ Desktop demo
  254. ├── webApp/ Web demo
  255. └── iosApp/ iOS demo
  256. ```
  257. ## License
  258. ```text
  259. Copyright 2026 Kyant (Original), Kashif Mehmood (KMP Port)
  260. Licensed under the Apache License, Version 2.0
  261. ```
  262. ## Links
  263. - [Original library](https://github.com/Kyant0/AndroidLiquidGlass) by Kyant
  264. - [API documentation](https://kyant.gitbook.io/backdrop)
  265. - [Maven Central](https://central.sonatype.com/artifact/io.github.kashif-mehmood-km/backdrop)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.