feDisplacementMap · liquid glass

Glass for the web.

One SVG filter bends the pixels behind each surface. A rounded-rectangle normal map — built on a canvas from a signed-distance field — tells feDisplacementMap how far to push the backdrop at every point: hard at the rim, flat in the middle, like a real convex lens. Three passes at slightly different scales split the light into a chromatic fringe. Drag the lens, tune it, then meet a kit of components built on the same surface.

drag me
Lens
Width260
Height170
Radius44
Refraction70
Blur2.0
Chroma0.16
01

The component kit

Every control below is the same GlassSurface at a different size — each generates its own displacement map and refracts the wallpaper underneath it. Interact with any of them.

Tabs
Segmented control
Switch
Low power
Value selector
2
seats
Buttons
Continue
Maybe later
Search
Dock
A
B
C
D
E
Now playing
Refraction
feImage · Side A
1:283:30
⏮
►
⏭

Core primitive: <feImage> supplies the generated map, <feDisplacementMap> bends the backdrop by it (R→x, G→y). Maps are rebuilt only when a surface changes size, never when it just moves — so dragging stays cheap. Refraction renders in Chromium; Safari/Firefox fall back to a frosted blur with the same rim light.