TetraKits UI Floating Particles ← Library

Floating Particles

Floating emerald particles rising with staggered CSS animation on dark zinc gradient. Elegant ambient motion for fintech, AI, and premium SaaS full-page backgrounds. Accepts children for overlay content.

floating particles bgparticle animation reactambient backgroundsaas hero particlesmotion background
Live preview

Dependencies

react
npm install react react-dom
const PARTICLES = Array.from({ length: 24 }, (_, i) => ({
  id: i,
  left: `${(i * 13 + 5) % 95}%`,
  size: 4 + (i % 4) * 2,
  delay: `${(i % 8) * 0.6}s`,
  duration: `${4 + (i % 5)}s`,
}));

export function FloatingParticlesBackground({ children }: { children?: React.ReactNode }) {
  return (
    <div className="relative min-h-screen overflow-hidden bg-gradient-to-b from-zinc-900 to-zinc-950">
      {PARTICLES.map((p) => (
        <span
          key={p.id}
          className="pointer-events-none absolute bottom-0 rounded-full bg-emerald-400/40 blur-[1px]"
          style={{
            left: p.left, width: p.size, height: p.size,
            animation: `float ${p.duration} ease-in-out ${p.delay} infinite`,
          }}
          aria-hidden
        />
      ))}
      <style>{`@keyframes float{0%,100%{transform:translateY(0);opacity:0}10%{opacity:.8}90%{opacity:.3}100%{transform:translateY(-100vh);opacity:0}}`}</style>
      {children && <div className="relative z-10">{children}</div>}
    </div>
  );
}