Skip to content
party.js logoparty.js logo

Effects

Confetti

Paper-like confetti that bursts in an upwards cone.

Live Demo

import { confetti } from "party-js";
confetti(button);

PlaygroundsTry it in the effects playground

Pass the element the confetti should come from. The confetti shoots out of the middle of the element, fast and mostly along its angle. Drag slows it down within a fraction of a second, and it then flutters down slowly like paper, swaying as it tumbles.

import { confetti, range } from "party-js";
button.addEventListener("click", () => {
confetti(button, {
count: range(40, 60),
spread: 70,
});
});

You can find a complete list of options and their defaults in the reference.