Particles
Move your pointer through them.
Installation
$ pnpm dlx shadcn@latest add @synccn/particlesFirst time in this project? Connect synccn with one command.
Usage
import { Particles } from "@/components/ui/particles";<div className="relative"><Particles /></div>API reference
Generated from the component's TypeScript types, so it always matches the code.
Particles
Floating particles on a canvas that drift away from the pointer. Place inside a relative container; it fills it.
- quantity
numberDefault
70Number of particles.
- color
stringCSS colour. Defaults to the text colour.
- size
numberDefault
1.4Base particle radius in pixels.
- ease
numberDefault
0.06How quickly particles react to the pointer, 0–1.
- repel
numberDefault
80Radius around the pointer that pushes particles away.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- Respects the reduced motion setting