Particle Field
Canvas-based floating particles with mouse-repulsion physics and responsive connecting lines.
npx uniqueui add particle-field
Preview
Interactive
Particle Field
Usage
import { ParticleField } from "@/components/ui/particle-field";
export default function Example() {
return (
<div className="rounded-xl overflow-hidden border border-neutral-800 h-[400px] w-full relative bg-neutral-950">
<div className="absolute inset-0 z-10 pointer-events-none flex items-center justify-center">
<h3 className="text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-b from-white to-neutral-500">
Hover Around
</h3>
</div>
<ParticleField
particleCount={120}
particleColor="#a855f7"
speed={0.5}
/>
</div>
);
}Props
| Prop | Type | Description |
|---|---|---|
particleCount | number | The number of particles rendered dynamically. |
particleColor | string | The hex color code for the particles and connecting lines. |
speed | number | The base movement speed multiplier. |
interactionRadius | number | The pixel radius for the mouse repulsion event. |