liquid-glass: The React component that makes blur feel physical

A deep dive into a TypeScript UI library that bends, splits, and springs light into a convincing glass material.

8 min read • View on GitHub • More from Leonxlnx

A glass card floats above a gridded surface as a cursor approaches from the side and the panel bows inward. The scene shows that the effect is not just blur, but a material response that changes with proximity.
The blur is only the starting point. The card reacts like a surface with tension, not a pane of tinted plastic.
Key Takeaways

The blur is only the surface

Most glassmorphism stops at backdrop-filter. This repo treats that as the floor, not the finish. The point is not to paint a translucent card. The point is to make the browser simulate a material that has edge tension, optical splitting, and weight.

A realistic frosted glass UI component for React with chromatic aberration, edge refraction, and spring physics.

Leonxlnx, Author/Maintainer · Leonxlnx/liquid-glass README

That description is accurate, but it still undersells the project. The effect feels convincing because it reacts before the cursor touches it, which makes the card feel alive instead of merely glossy.

Watch the card react before you touch it

The repo's most interesting move is proximity. computeElasticDeformation starts pulling on the card inside a roughly 200 pixel radius, so the surface changes shape before the pointer lands. computeSpringOffset adds a damped follow-through, which keeps the card from snapping like a UI trick.

A cursor does not just hover over the card. It changes the numbers that drive every layer under the glass.

That sequence is the whole thesis in miniature. Cursor distance becomes intensity, intensity becomes deformation, deformation becomes refraction, and the refraction changes again when the browser cannot support the full path.

The rendering stack underneath the illusion

The stack is hybrid on purpose. CSS provides the blur and saturation. SVG filters handle the refraction and channel splitting. Canvas generates the distortion texture. React owns the state and dimensions, while useId keeps multiple glass layers from colliding in the DOM.

This base component implements a sophisticated liquid glass effect using SVG filters, specifically leveraging feTurbulence and feDisplacementMap to create dynamic distortion effects that simulate liquid-like behavior when users interact with elements.

Leonxlnx, Author/Maintainer · Leonxlnx/liquid-glass README
const deformation = computeElasticDeformation(pointer, bounds)
const spring = computeSpringOffset(pointer, bounds)
const canRefraction = supportsBackdropSvgFilter()

return canRefraction ? (
  <GlassSurface deformation={deformation} spring={spring} />
) : (
  <ShimmerOverlay intensity={spring.intensity} />
)
A tight crop on the corner of a glass card shows the background grid bending through the edge. A thin split in the rim suggests chromatic aberration, which explains how the repo gets from blur to convincing refraction.
The expensive part is the edge, not the fill. The border has enough optical distortion to sell the material.

That split between blur, refraction, and motion is why the component feels composed rather than decorative. Each layer does one job, and the jobs are ordered the way light would behave in the real world.

Why browser support changes the design

This is where the repo gets practical. Chromium can take the richer SVG filter path, while Safari and Firefox lean on a shimmer overlay that keeps the surface legible when the full refraction stack is less dependable. That is a smart tradeoff because it treats fidelity as a spectrum, not a yes or no.

The same glass card appears in two browser contexts side by side. One version shows full refraction and edge splitting, while the other uses a lighter shimmer fallback, which makes the browser capability tradeoff easy to see.
The component does not pretend every browser can do the same trick. It preserves the interaction and adapts the fidelity.
Browser pathWhat it rendersWhy it exists
Chromium-based browsersFull blur plus SVG displacement, chromatic channel splitting, and spring-driven deformationBest visual fidelity when the filter stack behaves consistently
Safari and FirefoxShimmerOverlay fallback with lighter distortionKeeps the experience usable when the deeper filter path is less reliable

The important part is not that one path is prettier. It is that the component knows when to refuse heroics and preserve the interaction instead.

What makes it different from ordinary glassmorphism

Plain glassmorphism is a skin. liquid-glass is a system. It combines interaction physics, refraction, and browser-specific routing, so the card feels as if it has state, not just style.

ApproachVisual realismInteraction modelBrowser sensitivityImplementation burdenBest use case
Plain CSS glassmorphismBlur only, readable but flatUsually hover or noneLowLowBackground cards and dashboards
liquid-glassRefraction, aberration, and spring motionProximity, hover, and pressMediumHigherPremium UI moments and hero panels
Generic component kitStyled translucency with standard component behaviorConventional UI statesLow to mediumLowestShipping product UI quickly
Svelte liquid glass generatorHigh fidelity liquid glass with a generator workflowInteractive and framework-friendlyMediumMediumCross-framework demos and experiments

That is the niche. It is not the cheapest way to get glass on a page, and it is not the broadest library. It is the most explicit attempt here to make glass behave like a material under stress.

Why this repo exists

Leonxlnx built the component around a reusable GlassLayer, not a one-off demo, which says a lot about the ambition. This is meant to slot into real UI, where unique filter IDs, hover states, and fallback logic matter more than a perfect screenshot. In that sense, the repo answers a common product request with uncommon depth: make it look premium, but make it survive contact with browsers.

The result is a small but telling shift in how frontend effects get built. Instead of asking how to fake glass, this repo asks how to model a material well enough that the browser can react to it.