ValyroUI Русская версия

Particles

Particle field that reacts to the cursor. Pro · Effects › Backgrounds

A field of softly drifting particles behind content, in depth: near ones are larger, brighter, quicker and shift further as the pointer moves, far ones are small and calm. They make way for the pointer and spring back, a click or tap sends a ring of push through them, and they can join into a faint constellation. Drawn on a canvas at a capped pixel ratio; the loop runs only while the field is on screen and the tab is visible. The field fades in on mount and particles fade at the edges instead of popping as they wrap. Touch gets the drift and the tap; reduced motion draws one still frame. Colour and glow come from the theme.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add particles
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { Particles } from 'valyro-ui-pro';

Props

PropTypeDefault
quantitynumber80Number of particles.
speednumber1Drift speed multiplier; 0 holds them in place.
interaction'repel' | 'attract' | 'none''repel'How particles react to the pointer: pushed aside, drawn in, or not at all.
colorstringParticle colour. Default: the theme's --ui-particles-color.
colorsstring[]Several CSS colours the particles are picked from (overrides color).
glownumberSoft halo around each particle, 0–1 (default: the theme's --ui-particles-glow) — a starry, gravity-field look.
influencenumberPOINTER_RADIUSRadius of the pointer's pull or push, px (default 120).
strengthnumber1Strength of the pull or push, as a multiple of the default (default 1).
parallaxnumber14How much the field shifts in depth as the pointer moves, px at the nearest particles (default 14; 0 keeps it flat).
linksnumber0Joins particles closer than this many px with faint lines, like a constellation (default 0 — off).
burstbooleantrueA click or tap sends a ring of push through the particles around it (default true).

Related components

Previous: Background Pattern · Next: Animated Border · All Effects