Create Instance.
Target Canvas (null or omitted creates a fullscreen overlay on first fire())
Instance Options
Destroy Instance. Stops everything, removes listeners and the overlay canvas. The instance cannot fire afterwards.
Start a Continuous Emitter.
Streams particles at rate per second from what it follows (an element, the pointer or a point) until
you call stop(); the particles already out then finish their lives and the handle resolves.
Emitter Options (every fire() setting except particleCount, origin, emission)
Emitter Handle
Fire Burst (or Several Bursts at Once).
Burst Options (merged over the instance defaults), or an array of them
Awaitable Burst Handle (a combined handle for arrays)
Return Canvas Element.
Canvas Element
Return Live Particle Count.
Live Particle Count
Return the Adaptive Quality Level.
Always 0 without the adaptiveQuality option.
Level: 0 full quality, 1 CSS resolution, 2 no shadows / shine / trails, 3 fewer particles
Return Destroyed State.
Destroyed State
Check Whether pause() Is in Effect.
Paused Flag
Fire on Every Click.
Bursts start at the click position unless the options set their own origin.
Element (or window) to Listen On
Optionaloptions: FireInput | ((event: MouseEvent) => FireInput)
Burst Options, or a Function Building Them from the Click Event
Trigger Event and Burst Callback
Unsubscribe Function
Pause Everything.
Freezes every running burst on its current frame; bursts fired while paused wait as well. Use it when
the confetti is not visible, e.g. on an MRAID viewableChange in a playable ad. Hidden tabs already
pause automatically.
Stop All Bursts and Clear Canvas.
Resume After pause(). Continues exactly where the bursts stopped; the paused time does not count as elapsed.
Konfeti Instance. Binds a canvas (or a fullscreen overlay) to its own engine, pool and default options.
Example