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
| Prop | Type | Default | Description |
|---|---|---|---|
trigger | boolean | false | Set to true to fire confetti programmatically. Reacts to falseβtrue transitions. |
children | ReactNode | β | Clicking these children fires the confetti. |
count | number | 120 | Number of particles launched. |
colors | string[] | β | Array of hex color strings for particles. |
gravity | number | 0.4 | Downward gravity applied each frame. |
className | string | β | Additional classes for the canvas wrapper. |