Backgrounds

Constellation

A constellation network — drifting particles link by proximity, chase and flee the cursor, and glow.

Install

# Constellation needs no npm packages

Then copy 2 files into your project:

  • components/registry/constellation/constellation.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
densitynumber1Particle density relative to area.
speednumber0.8Top drift speed of particles.
connectDistancenumber120Max distance for particle-to-particle lines.
cursorDistancenumber150Cursor link + repel radius; 0 disables.
repelForcenumber2Push strength inside the cursor radius.
lineOpacitynumber0.5Opacity multiplier on connection lines.
glownumber10Particle glow blur.
color1string (hex)"#a855f7"First particle color.
color2string (hex)"#ff9207"Second particle color.
color3string (hex)"#22d3ee"Third particle color — lines between mixed pairs blend as gradients.

What It Demonstrates

Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Hover effect
Visual change when the cursor moves over an element.
Float
A gentle, continuous up-and-down drift that makes a static element feel alive and weightless.
Loop
An animation that repeats, a set number of times or infinitely.

Related Components

Appears In