Components / Backgrounds
Particles
A drifting constellation of particles that link up with each other and with your cursor.
Everything is connected
Move your cursor through the network.
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
None. This component only needs React and Tailwind.
- 2
Add the component
Copy the code from the Code tab above into
components/ui/particles.tsx. - 3
Use it
example.tsximport { Particles } from "@/components/ui/particles"; export default function ParticlesDemo() { return ( <Particles className="h-72 w-full rounded-2xl border border-zinc-200 dark:border-white/10 bg-white dark:bg-zinc-950"> <div className="pointer-events-none flex h-full flex-col items-center justify-center text-center"> <h3 className="text-2xl font-semibold text-zinc-900 dark:text-white">Everything is connected</h3> <p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Move your cursor through the network.</p> </div> </Particles> ); }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| count | number | 70 | Number of particles. |
| color | string | "#fdba74" | Particle and line color. |
| linkDistance | number | 110 | Max distance (px) to connect two particles. |
| speed | number | 1 | Movement speed multiplier. |
| interactive | boolean | true | Connect particles to the cursor. |