Skip to content
← The index

Liquid Glass

A WebGL lens that refracts, reflects, and softens typography or images beneath the glass.

Copy for agent

Move over the preview. Focus it and use the arrow keys to move the glass.

The idea

The lens traces refraction through the rendered scene beneath it. Reflections follow the glass surface, while Chroma separates the transmitted red, green and blue samples.

import { LiquidGlass } from "@/components/liquid-glass/liquid-glass";

export function Example() {
  return <LiquidGlass
    mode="lucid"
    source={{ kind: "image", src: "/photo.jpg", alt: "A portrait" }}
    label="Portrait through liquid glass"
    cornerMorph={0.35}
  />;
}

Interaction

Move the pointer across the lens or focus the preview and use the arrow keys. Choose typography, a photograph, an illustration or a local image. The image stays in your browser.

Lucid adds a small corner deformation. Mist blurs the scene beneath the glass and keeps the lens marks sharp. Reduced motion stops the pointer-follow movement.

Adapted from desdivj's Liquid Glass reference. The original implementation was unavailable. This component reconstructs the visible optical behavior with an independent WebGL implementation.

Properties

PropertyTypeDefaultDescription
mode"chroma" | "swell" | "lucid" | "mist""chroma"Chromatic dispersion, stronger curvature, clear transmission, or Gaussian frosting.
sourceLiquidGlassSourceTypographyTypography accepts lines, displayFont and serifFont. Images use { kind: "image", src, alt }.
labelstringDerived from sourceAccessible name for the rendered scene.
cornerMorphnumber0.35Lucid corner deformation from 0 to 1. Other modes ignore this setting.
reducedMotionbooleanfalseUse the still pointer path. The system preference also applies.
className / stylestring / CSSPropertiesOptionalStyle the scene container.