uiniverse

backgrounds

Particles

Floating particle field rendered on Canvas with optional connecting lines between nearby particles.

v1.0.0react >=18next >=14tailwind >=4
backgroundparticlescanvasnetworkconstellationdecorativeanimated

Preview

Loading preview...

Props

PropTypeDefaultDescription
countnumber50Number of particles
colorstring#ffffffParticle color (any CSS color value)
speednumber1Speed multiplier for particle movement
sizenumber2Particle radius in pixels
connectedbooleanfalseDraw lines between nearby particles
maxDistancenumber100Maximum distance for connected lines in pixels
classNamestringAdditional Tailwind classes
idstringHTML id attribute

Layout

Display: block
Responsive: No

Fills container with absolute positioning. Canvas auto-resizes via ResizeObserver. Requires a relative-positioned parent.

Examples

Basic floating particles

<div className="relative h-96 bg-black">
  <Particles />
</div>

Connected network effect

<div className="relative h-screen bg-neutral-950">
  <Particles count={100} connected maxDistance={120} color="#8b5cf6" />
  <div className="relative z-10 flex items-center justify-center h-full">
    <h1 className="text-white text-4xl font-bold">Network</h1>
  </div>
</div>

Slow, large particles

<div className="relative h-96 bg-black">
  <Particles count={30} size={4} speed={0.3} color="rgba(255,255,255,0.5)" />
</div>

AI Usage Hint

Use Particles for atmospheric floating dots. Enable 'connected' for a network/constellation effect. Adjust count (50-200 typical), speed, and size. Great for hero backgrounds or empty states.

Works Well With

GradientMeshAurora