Confetti

Canvas-based physics confetti. Fire it by wrapping clickable children or trigger it programmatically via the trigger prop.

import { Confetti } from "@animui/ui"

Click to fire

Wrap any element with Confetti. Clicking the child fires the burst.

Programmatic trigger

Use trigger for externally controlled bursts. Reset the value after firing so subsequent triggers work.

Props

PropTypeDefaultDescription
triggerbooleanfalseSet to true to fire confetti programmatically. Reacts to false→true transitions.
childrenReactNodeβ€”Clicking these children fires the confetti.
countnumber120Number of particles launched.
colorsstring[]β€”Array of hex color strings for particles.
gravitynumber0.4Downward gravity applied each frame.
classNamestringβ€”Additional classes for the canvas wrapper.
Β© 2026 Steal Shadow. MIT License.Report an issue