Skip to main content

Built and signed on GitHub Actions

This package allows you to throw confetti on a page, within the browser.

This package works with Browsers
This package works with Browsers
JSR Score
100%
Published
6 months ago (2.0.0)
function throwConfetti
throwConfetti(options?: ThrowConfettiOptions): unknown

Generates a canvas that has confetti in it.

Parameters

optional
options: ThrowConfettiOptions

Optional settings object to configure how the confetti behaves.

import { throwConfetti } from '@adam/confetti'

throwConfetti()
import { throwConfetti, defaultCanvasStyles } from '@adam/confetti'

throwConfetti({
canvasId: 'custom-canvas-id',
customStyles: {
...defaultCanvasStyles,
width: '500px',
height: '500px',
},
particleCount: 300,
secondsUntilDeletion: 8,
selectorToAppend: 'main',
})

Return Type

unknown