LogoBanner
GitHubTwitter

Electric Storm Shader

Dramatic lightning effect with storm atmosphere.

Required Dependencies

npm install three @types/three @react-three/fiber

NPM Installation (Recommended)

npx shaderz add

Select "Electric Storm" from the interactive list.

Basic Usage

import ElectricStorm from '@/components/shaders/electric-storm/Hero';

export default function App() {
  return (
    <div style={{ width: '100%', height: '500px' }}>
      <ElectricStorm />
    </div>
  );
}

Full Screen Hero Background

To use the shader as a background, position it absolutely within a relative container and place your content on top using z-index.

import ElectricStorm from '@/components/shaders/electric-storm/Hero';

export default function HeroSection() {
  return (
    <div className="relative w-full h-screen overflow-hidden">
      {/* Shader Background */}
      <div className="absolute inset-0 z-0">
        <ElectricStorm />
      </div>

      {/* Content Layer */}
      <div className="relative z-10 flex flex-col items-center justify-center h-full text-white">
        <h1 className="text-6xl font-bold">Your Content Here</h1>
      </div>
    </div>
  );
}

Manual Installation

Alternatively, copy the component code directly into your project at components/shaders/electric-storm/Hero.tsx

Full Component Code

'use client';
import React from 'react';
import ElectricStorm from './ElectricStorm';

const Hero: React.FC = () => {
    return (
        <div className="absolute inset-0 w-full h-full overflow-hidden bg-black">
            <ElectricStorm
                hue={260}
                speed={1.0}
                intensity={1.5}
                branches={3}
                cloudDensity={0.6}
            />
        </div>
    );
};

export default Hero;