Command Palette

Search for a command to run...

Docs
Mouse Spark

Mouse Spark

Interactive mouse-following particle effect with customizable colors and themes

Move your mouse to see the spark effect!

Installation

Props

PropTypeDefaultDescription
widthnumber800Canvas width in pixels
heightnumber600Canvas height in pixels
theme"light" | "dark""light"Color theme for particles and background

Features

  • Mouse Tracking: Particles spawn at mouse cursor position
  • Smooth Animation: Particles fade out with physics-based movement
  • Theme Support: Light and dark color schemes
  • Performance Optimized: Automatic particle cleanup and efficient rendering
  • Responsive: Adapts to any canvas size

Usage Examples

Basic Usage

import MouseSpark from "@/components/mouse-spark";
 
export default function App() {
  return (
    <div className="relative h-screen">
      <MouseSpark />
      <div className="relative z-10 p-8">
        <h1>Your content here</h1>
      </div>
    </div>
  );
}

Custom Size and Theme

import MouseSpark from "@/components/mouse-spark";
 
export default function App() {
  return (
    <div className="relative h-96 w-full">
      <MouseSpark width={800} height={400} theme="dark" />
    </div>
  );
}