Confetti is a small animation to add a confetti effect in your SvelteKit application. You can
trigger the confetti by calling the confetti function and passing the options as you like.
particleCount200duration12000zIndexz-index of the confetti canvas. The default sits above modals and toasts.20000000<script>
import { confetti } from '$lib/components/Confetti/confetti.js';
const triggerConfetti = () => {
// Bursts from the centre and ends once every particle has fallen off screen
// Options (all optional): particleCount = 200, duration = 12000, zIndex = 20000000
confetti();
};
</script>
<Button onclick={triggerConfetti}>Trigger Confetti</Button>The confetti canvas uses a high z-index, so it renders above overlays such as modals
and toasts. This means you can fire it straight from a modal action button.