Particle Background

Animated canvas background with floating text, emojis, or images connected by lines. Supports arrows and mouse interaction.

Import

import { ParticleBackground } from "@igorao79/uivix";

Playground

Move your mouse over the canvas

180px
200px
1x

Usage

{/* Text labels */}
<ParticleBackground
  items={["React", "Next.js", "Tailwind", "TypeScript"]}
  connectionDistance={180}
  arrows
/>

{/* Emojis */}
<ParticleBackground
  items={["⭐", "🚀", "🔥", "⚡"]}
  color={[180, 130, 80]}
/>

{/* Mixed with images */}
<ParticleBackground
  items={[
    "PNG",
    { content: "🖼️", type: "emoji" },
    { content: "/logo.png", type: "image" },
  ]}
  arrows
/>

Props

PropTypeDefaultDescription
items(string | ParticleNode)[]-Array of text, emoji, or image items (required)
countnumberautoMax number of particles (auto-scales with screen)
connectionDistancenumber180Max distance for connection lines (px)
arrowsbooleanfalseShow arrowheads on connection lines
mouseDistancenumber200Mouse interaction distance (px)
color[r, g, b][110, 120, 220]Base color for text and lines
speednumber1Movement speed multiplier
fontSize[min, max][13, 18]Font size range in px
imageSizenumber28Size of image particles in px
lineWidthnumber0.6Connection line width
maxOpacitynumber0.25Maximum particle opacity
classNamestringfixed inset-0 ...CSS class for the canvas

ParticleNode

PropTypeDefaultDescription
contentstring-Text, emoji, or image URL
type"text" | "emoji" | "image""text"Content type (auto-detected for strings)