Skip to content

Liquify Lens

A movable glass lens that refracts your image.

LIVE PREVIEWInteract with the component
Install dependencies

npm install @react-three/fiber three

CSS Modules

Usage

Matches your current playground settings.

jsx
import LiquifyLens from "./LiquifyLens";
export default function Example() {
return (
<LiquifyLens
backgroundImageUrl={"https://reactverse.dev/images/nebula_rift.webp"}
lensSize={280}
strength={0.75}
minHeight={520}
/>
);
}

Using Liquify Lens

Supply your own artwork through backgroundImageUrl and set minHeight to reserve its visible area.

lensSize changes the refracting region and strength changes the distortion. Use a clear source image and moderate distortion when its content matters.

Props

NameTypeRequiredDefaultDescription
backgroundImageUrlstringNo""Background image URL for the base layer.
lensSizenumberNo280Diameter of the lens in pixels.
strengthnumberNo0.75Strength of the distortion effect (0 to 1).
classNamestringNoundefinedAdditional CSS class names, merged with base component styles.
minHeightnumber | stringNo520Minimum height for the component container. Accepts a number (pixels) or any valid CSS height string.
mouseRefReact.MutableRefObject<{ x: number; y: number }>NoundefinedOptional pointer ref for external cursor tracking, values in the range [-1, 1].

Related components

Glacial Rift

Backgrounds

Sculpted ice walls frame a luminous, slowly shifting blue crevasse.

Solar Veil

Backgrounds

Copper light curtains hang in fine, flowing folds above a dark horizon.

Opal Current

Backgrounds

Pearlescent liquid folds shift between jade, rose and soft silver.

Event Horizon

Backgrounds

A dark celestial silhouette bends warm orbital threads into a glowing disc.