vue-confetti-explosion is a lightweight and performant Vue 3 component designed to create customizable confetti explosion animations. Currently at version 1.0.2, this library is a direct port from popular Svelte and React counterparts, offering a consistent API for triggering celebratory visual effects within Vue applications. It focuses on simplicity and performance, generating a specified number of confetti particles with options for size, duration, color arrays, and explosion force. While it doesn't specify a strict release cadence, updates are likely tied to major Vue 3 ecosystem shifts or bug fixes. A key differentiator is its minimal API and ease of integration into `<script setup>`-style Vue components, making it an ideal choice for adding quick, dynamic visual flair without significant overhead.
npm install vue-confetti-explosionVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically trigger a confetti explosion on a button click, ensuring the component re-renders for each new effect with custom options.
Ensure the parent container's CSS includes `overflow: visible` to allow particles to spread freely and fully animate.
Adjust the `stageHeight` prop to a larger value (e.g., `:stageHeight="1000"`) to ensure particles fall out of view gracefully.
Always ensure `force` is set to a value like `0.5` (default) or any float between `0` and `1` (e.g., `:force="0.75"`).
Do not attempt to use `--x` or `--y` CSS variables for positioning on the `ConfettiExplosion` component; they are not supported by this Vue component and will have no effect.
Set `overflow: visible` on the CSS of the component's direct or indirect parent container where the confetti should expand.
Change the `force` prop to a value between 0 and 1 (e.g., `:force="0.75"`).
Increase the `stageHeight` prop (e.g., `:stageHeight="1200"`) to allow confetti to fall further down before disappearing from view.