ReferenceEffectsFunction
confetti()
Emits a burst of confetti.
function confetti(target: EffectTarget, options?: ConfettiOptions): Effect;Fires a burst of confetti in a cone, upwards by default, from the specified target.
The confetti shoots out of the middle of the target, fast and mostly along angle. Drag slows it down within
a fraction of a second, and it then flutters down slowly like paper, swaying as it tumbles. It grows to its full
size over its first 0.03 seconds, fades out over its last second, and is lit with a glossy sheen (peak: 1.5).
Parameters
Section titled “Parameters”targetEffectTargetThe target the confetti bursts out of. Its position and size are read once, when the effect starts.
optionsoptionalConfettiOptionsOverrides of the default options. See ConfettiOptions for all fields.
Returns
Section titled “Returns”EffectA handle to the running effect.
Example
Section titled “Example”button.addEventListener("click", () => confetti(button, { spread: 70 }));