Liquid Glass
A WebGL lens that refracts, reflects, and softens typography or images beneath the glass.
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.