explaingit

deepika-builds/liquid-glass

Analysis updated 2026-05-18

214JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A one file, zero dependency JavaScript library that gives web elements a realistic bending glass look, with a blur fallback for browsers that cannot do the real effect.

Mindmap

mindmap
  root((liquid-glass))
    What it does
      Bending glass effect
      Prism edge fringe
      Frosted fallback
      One file no deps
    Tech stack
      JavaScript
      SVG filters
      CSS
      backdrop-filter
    Use cases
      Glass cards
      Navigation bars
      Modals and buttons
    Browser support
      Chromium real effect
      Safari Firefox fallback

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add an Apple style glass panel effect to cards, navigation bars, or buttons on a website.

USE CASE 2

Give a modal or floating UI element a translucent bending glass look instead of a flat blur.

USE CASE 3

Build a visually distinctive landing page or portfolio site with a modern glass aesthetic.

What is it built with?

JavaScriptSVGCSS

How does it compare?

deepika-builds/liquid-glassgaearon/promise-loaderpolymarket-trader-lab/polymarket-trading-bot
Stars214213213
LanguageJavaScriptJavaScriptJavaScript
Last pushed2016-08-02
MaintenanceDormant
Setup difficultyeasymoderatehard
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Real refraction only works in Chromium browsers, Safari and Firefox get an automatic blur fallback.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

liquid-glass recreates the Apple style translucent glass panel effect for websites. It makes an element look like a piece of glass that visibly bends the content behind it near its edges, with a faint rainbow fringe at the rim, while the text and content inside stay easy to read. The whole thing lives in one JavaScript file with no other packages to install, and it can be attached to any element on a page. The real bending effect only works in Chromium based browsers such as Chrome, Edge, Arc, and Brave. In Safari and Firefox, which do not support the underlying browser feature, the library automatically falls back to a simple frosted blur look instead, so the page still looks reasonable everywhere. Using it is a two step process. You load the script and give an element a class, then call a single function on that element to turn on the glass effect. The returned object tells you whether the real refraction is supported, lets you refresh the effect after you resize things by hand, and lets you turn the effect off and remove it. The actual glassy appearance, like the tint, shadow, and border, is written as normal CSS on the element itself, separate from the script's job of handling the underlying optical trick. Under the hood, the library draws a special image that encodes how light should bend, then feeds that into a browser SVG filter with several passes to create the color fringing at the edges. This is applied through a backdrop filter, meaning the real content behind the glass is what refracts, so text stays selectable and buttons stay clickable. The README notes some limits: the special color setting the module applies internally is required for the effect to look right, the interior should be kept legible by adjusting a few settings rather than making the background opaque, and the effect is best suited to smaller elements like cards, navigation bars, and buttons rather than very large areas of the page, since generating the effect is demanding on the browser. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Show me how to attach liquid-glass to a card element in my HTML page and adjust the scale and blur options.
Prompt 2
How do I use liquid-glass inside a React component with a useEffect hook and clean up the effect on unmount?
Prompt 3
Explain how to tune the liquid-glass options so the interior text stays readable on a busy background.
Prompt 4
Write the CSS needed alongside liquid-glass to make a navigation bar look like frosted glass.

Frequently asked questions

What is liquid-glass?

A one file, zero dependency JavaScript library that gives web elements a realistic bending glass look, with a blur fallback for browsers that cannot do the real effect.

What language is liquid-glass written in?

Mainly JavaScript. The stack also includes JavaScript, SVG, CSS.

What license does liquid-glass use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is liquid-glass to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is liquid-glass for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.