CSS Confetti Generator
Design confetti animations and copy lightweight HTML, CSS and JS
Preview and code update as you edit.
Related Tools
How to use it
- 1.Pick an effect or load a preset.
- 2.Edit the colors, piece count, shape and size in Pieces.
- 3.Tune duration, spread, fall distance, drift and spin in Motion.
- 4.Choose CSS only for decorative confetti or On event for a burst you trigger after a success.
- 5.Copy or download the HTML, CSS and, for On event, the JavaScript.
What is the CSS Confetti Generator?
A visual builder for confetti animations. Choose Falling, Burst, Cannon or Background, set the colors, piece count, shapes, sizes and motion, and copy production-ready code. The preview plays the same CSS that you copy.
Repeatable, accessible output
A seeded generator writes each piece as CSS custom properties, so the same seed and settings always give identical code. Pieces animate only transform and opacity, the confetti layer is aria-hidden, and a prefers-reduced-motion block hides the confetti for visitors who ask for less motion. On event code removes its pieces when the animation ends.
Limits
Up to 600 pieces; more than 300 shows a performance warning. Sizes use container query units, which need a browser released in 2023 or later. Settings are saved only in this browser.
Frequently asked questions
- Will the same settings always give the same confetti?
- Yes. A seeded generator computes every piece, so the same seed and settings always produce identical HTML, CSS and JavaScript. Change the seed or select New seed for a different arrangement.
- Does the confetti respect reduced motion?
- Yes. The CSS always includes a prefers-reduced-motion block that hides the pieces, the event trigger does nothing for those visitors, and the confetti layer is aria-hidden so screen readers skip it. Keep your success message outside the confetti layer.
- When should I use CSS only versus On event?
- Use CSS only for decorative or looping confetti that plays when the page loads, with no JavaScript. Use On event for a burst after a success action: call triggerConfetti() and the pieces are added, animated and removed automatically.
