Fluid Cursor
Move your mouse around to generate a beautiful, performant HTML5 canvas smoke trail.
Installation
npx kinetic-ui-cli@latest add fluid-cursor-trail
How It Works
Instead of using an incredibly heavy WebGL Navier-Stokes fluid simulation solver (which can kill battery life and framerates), this component achieves a near-identical aesthetic using the native HTML5 Canvas 2D API. It spawns soft-edged radial gradients that inherit cursor momentum. By overlapping these gradients with globalCompositeOperation = "screen", they optically blend together to create the illusion of illuminated smoke.
Usage Guide
1. Import the Component
Import the component into your React or Next.js page:
import { FluidCursorTrail } from "@/components/creative/fluid-cursor-trail";
2. Implementation Example
Render the component and customize its behavior by passing props:
import { FluidCursorTrail } from "@/components/creative/fluid-cursor-trail";
export default function Example() {
return (
<div className="w-full flex items-center justify-center p-8">
<FluidCursorTrail
particleColors="example"
/>
</div>
);
}