Free · MIT · React + Tailwind

Particles Background for React

A lightweight particles background for React and Tailwind CSS using deterministic elements and CSS animation. It respects reduced-motion preferences and needs no animation library.

Build among the stars

Copy the code

const particles = Array.from({ length: 36 }, (_, i) => ({
  left: (i * 37) % 100,
  top: (i * 53) % 100,
  delay: (i % 8) * 0.35,
}))

export function ParticlesBackground() {
  return (
    <div className="relative min-h-80 overflow-hidden rounded-3xl bg-slate-950">
      {particles.map((particle, i) => (
        <span key={i} aria-hidden="true"
          className="absolute h-1 w-1 animate-pulse rounded-full bg-violet-300 motion-reduce:animate-none"
          style={{ left: particle.left + '%', top: particle.top + '%', animationDelay: particle.delay + 's' }} />
      ))}
      <div className="relative grid min-h-80 place-items-center text-3xl font-bold text-white">Build among the stars</div>
    </div>
  )
}

Tailwind CSS · no dependencies · MIT licensed. Paste it straight into any React, Next.js or Vite project.

About the particles background

This particles background is part of Empire UI - a free, open-source library of 34+ component types rendered across 41 visual styles, from glassmorphism to neo-brutalism. Every block is copy-paste ready in React and Tailwind CSS with no runtime dependencies.

Want it in a different look? Browse all 41 styles or grab the matching glassmorphism components.

Related backgrounds components

Animated Background