Shader Morphing

PreviousNext

The `ShaderMorphing` component renders a full-screen animated shader effect using **Three.js** and GLSL. It creates a morphing, neon-like gradient background that continuously evolves over time.

shader-morphing-default

Installation

pnpm dlx shadcn@latest add https://ui.dalim.in/r/styles/default/shader-morphing.json

Usage

import { Shaderlines } from "@/components/ui/shader-morphing"
<div className="relative h-screen w-full">
      {/* Background Shader */}
      <ShaderMorphing />
 
      {/* Foreground Content */}
      <div className="relative z-10 flex items-center justify-center h-full">
        <h1 className="text-5xl font-bold text-white">Shader Morphing</h1>
      </div>
    </div>

Props

PropTypeDefaultDescription
idstringOptional id for the root container <div>.
classNamestringOptional Tailwind/CSS classes applied to the container <div>.
styleReact.CSSPropertiesInline styles applied to the root container.
widthnumber | string"100%"Width of the canvas container.
heightnumber | string"100%"Height of the canvas container.
position"absolute" | "fixed" | "relative""absolute"CSS positioning for the container.
zIndexnumber-1Controls stacking order.
pointerEvents"none" | "auto""none"Whether to block or allow mouse interactions.
animationSpeednumber1.0Multiplier for shader animation speed.
transparentBgbooleantrueWhether the background is transparent.