DEV Community

loading...

🎉 Zero-config JS Confetti library

loonywizard profile image Vladimir Nikitin ・1 min read

js-confetti is a lightweight zero-config open-source JavaScript library for confetti without any dependencies

Alt Text

GitHub: https://github.com/loonywizard/js-confetti

Usage

Install library via yarn or npm

yarn add js-confetti
Enter fullscreen mode Exit fullscreen mode

Initialize instance of JSConfetti class and call addConfetti method

import JSConfetti from 'js-confetti'

const jsConfetti = new JSConfetti()

jsConfetti.addConfetti()
Enter fullscreen mode Exit fullscreen mode

Thats it!

Discussion (0)

Forem Open with the Forem app