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

Confetti

Confetti: a component and fireConfetti(). Pro · Effects › Cursor and press feedback

Confetti inside an area — a card, a dialog, a hero. Fire it with fireOnMount or through controlRef; for page-wide celebrations call fireConfetti() instead. Particles are drawn on a canvas at a capped pixel ratio, the loop runs only while particles are in the air, and nothing fires with reduced motion. The canvas is decorative and never takes pointer events.

Installation

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

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

Props

PropTypeDefault
fireOnMountbooleanfalseFire once when the component mounts — a success screen, an unlocked achievement.
controlRefRef<ConfettiHandle>Imperative handle: controlRef.current.fire() fires inside this area.
preset'burst' | 'cannons' | 'stars''burst'burst — a fountain from one point; cannons — two streams from the bottom corners; stars — a ring of stars.
particleCountnumberParticles per burst (per cannon).
colorsstring[]Colours. Default: the theme's --ui-confetti-colors.
scalarnumberSize multiplier.

Related components

Previous: Ripple · Next: Reveal · All Effects