Liquid Mask Crossfade

A WebGL shader component featuring interactive liquid cursor mask crossfade with dynamic trail, refraction, and parallax effects.

18 KB
•
Updated on September 23, 2026
Active on Canvas Stage

Installation

Bash
pnpm dlx shadcn@latest add @spaceui/components-shader-liquid-mask-crossfade

Usage

Code
import { LiquidMaskCrossfade } from '@/components/shader/liquid-mask-crossfade'

export default function Example() {
  return (
    <LiquidMaskCrossfade
      imageA="https://cdn.spaceui.one/atom/samples/image-0-f.png"
      imageB="https://cdn.spaceui.one/atom/samples/image-0-b.png"
      radius={0.15}
      distortion={0.18}
      refraction={0.14}
    />
  )
}

API Reference

PropTypeDefaultDescription
imageA
string
-Outer base texture URL
imageB
string
-Inner revealed texture URL
radius
number
0.15Base radius of the liquid cursor droplet
distortion
number
0.18Liquid noise distortion intensity
noiseScale
number
5.7Scale of the FBM procedural noise
speed
number
0.1Animation speed of procedural liquid noise
edgeSoftness
number
0.06Softness and blur width of the mask boundary
refraction
number
0.14Strength of the chromatic refraction effect
parallax
number
0.05Depth parallax movement of the inner image
mouseSmoothness
number
0.06Cursor lerp smoothing factor
trailLength
number
1.08Length spacing of the cursor droplet trail
trailPersistence
number
0.65Persistence and drag memory of the trail
trailTaper
number
0.86Taper ratio from cursor head to trail tail
idleDelay
number
2.0Seconds of inactivity before fade out begins
fadeDuration
number
0.35Fade-in duration when pointer enters or moves
fadeOutDuration
number
0.7Fade-out duration when cursor goes idle
aspectRatio
number
-Optional aspect ratio override
className
string
-Additional Tailwind CSS classes

Keep in mind

  • MIT License: Free and open-source for personal and commercial use. Feel free to copy, tweak, and adapt the components to match your exact needs.
  • Credits & Inspiration: Some components on this site are inspired by or recreated from great ideas across the web. I'm not here to take credit; just to learn, experiment, and push interface craft further.
  • Reach out & Claims: If an attribution was missed, or if you have any inquiry or claim, feel free to reach out directly on X to @adrielzimbril. I'll be glad to update or resolve it right away.

Related Components

CloudShader

Interactive volumetric cloud material rendered as a full-bleed shader surface.

View
Fluid CrossfadeShader

A dual-pass WebGL shader fluid simulation with chromatic wave refraction and Bayer 4x4 matrix ordered dither crossfading.

View
Fluid Distortion ImageShader

An interactive WebGL shader image component with cover UV mapping and dynamic cursor fluid-distortion ripples using data textures.

View
Fluid Dither Crossfade
Mesh Gradient
pnpm dlx shadcn@latest add @spaceui/components-spaceui-ui
pnpm dlx shadcn@latest add @spaceui/components-shader-liquid-mask-crossfade