PRO

Fluid Refraction

Pointer-driven fluid refraction over an image or video. Raw WebGL simulates velocity, pressure and density, then samples the media with RGB separation and highlights. Pure React and TypeScript.

Component
Install
npx shadcn@latest add @compronents/fluid-refraction

Installs from ui.aryank.space. Needs a registry token and a one-time @compronents entry in components.json. The docs walk through both.

Files
Checking access…
API
PropTypeDefaultDescription
image / videoexclusive string media union—Supply exactly one media URL, with CORS permission for WebGL texture upload. Rendered with cover cropping.
refractionAmountnumber15Distortion strength, source scale 0 to 100.
chromaticAberrationnumber10RGB refraction separation, source scale 0 to 100.
highlightnumber50Density-masked specular light, source scale 0 to 200.
disappearSpeednumber2Density percentage removed per frame.
velocityDissipationnumber99Velocity retention percentage per frame.
pressureDissipationnumber80Pressure retention percentage per frame.
pressureIterationsnumber25Pressure solver iterations per frame. The source-page demo uses 50.
curlnumber30Vorticity force strength.
splatRadiusnumber5Interaction radius, divided by 1000 for the shader.
interactOnHoverbooleantrueDisturb fluid on hover, or require pressing when false.
className / style / aria-labelstring / CSSProperties / string—Container sizing and accessible description. Give it an explicit height.
Dependencies
None.