Kinetic UI
Back to Introduction
3D Components

Liquid Fluid Shader

A WebGL shader material that distorts an image into a reactive liquid state.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add liquid-fluid-shader
Liquid Fluid Shader

Installation

npx kinetic-ui-cli@latest add liquid-fluid-shader

Architecture

This component is a native WebGL primitive built with Three.js and React Three Fiber. It maps a 2D image texture onto a plane geometry and uses a custom GLSL fragment shader to calculate the Euclidean distance from the user's cursor (uMouse).

As the cursor moves, it generates a sine-wave ripple effect dampened by the exponential distance from the pointer, creating a viscous fluid effect that executes on the GPU for maximum performance.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { LiquidFluidShader } from "@/components/creative/liquid-fluid-shader";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { LiquidFluidShader } from "@/components/creative/liquid-fluid-shader";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <LiquidFluidShader
        imageUrl="example"
        intensity{10}
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.