Kinetic UI
Back to Introduction
3D Components

WebGL Gallery

GLSL shader image gallery with chromatic aberration and liquid distortion transitions.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add webgl-gallery

The WebGLGallery component is a drop-in replacement for any standard image slider. Instead of boring slide or fade transitions, it uses a custom GLSL Fragment Shader running on the GPU to liquify, tear apart, and RGB-split the current image as it transitions to the next one.

The shader pipeline combines four simultaneous effects:

  1. Chromatic Aberration — Each RGB channel is sampled from a slightly different UV offset, creating the iconic "glitch" color splitting.
  2. Liquid Noise Distortion — A procedural 2D noise function warps the UV coordinates, making the image appear to melt.
  3. Wave Displacement — A sine wave ripples horizontally across the image during the transition.
  4. Dissolve Mask — A noise-driven dissolve boundary creates a non-linear crossfade between the two images.

All four effects peak at the midpoint of the transition (progress = 0.5) and smoothly ease in and out.

Live Preview

WebGL Gallery

Click the arrows or dots to trigger the shader transition.

Chromatic aberration · Liquid noise · Wave displacement · Dissolve mask

Installation

npx kinetic-ui-cli@latest add webgl-gallery

[!WARNING] GPU Requirement: This component runs a custom GLSL fragment shader on the GPU. It will not work on devices without WebGL support (extremely rare in 2025+). Performance is hardware-accelerated and typically runs at 60fps even on mobile GPUs.

Props

Usage Guide

1. Import the Component

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

import { WebGLGallery } from "@/components/creative/webgl-gallery";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { WebGLGallery } from "@/components/creative/webgl-gallery";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <WebGLGallery
        images="example"
        intensity{10}
        showControls{true}
      />
    </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.