Skip to content

Confetti

Confetti launches a burst of colored DOM particles when the trigger prop changes to true. It's renderless — particles are appended directly to the document body.

Basic usage

Tailwind v4
vue
<script setup>
import { ref } from 'vue'
const fired = ref(false)
function fireConfetti() {
  fired.value = false
  setTimeout(() => { fired.value = true }, 10)
}
</script>

<template>
  <Confetti :trigger="fired" />
  <button @click="fireConfetti">Launch Confetti 🎉</button>
</template>

Custom colors

vue
<Confetti :trigger="fired" :colors="['#ff6b6b', '#feca57', '#48dbfb', '#ff9ff3']" />

Focused origin

vue
<!-- Top-center burst -->
<Confetti :trigger="fired" :origin="{ x: 0.5, y: 0.1 }" :spread="120" />

Props

PropTypeDefaultDescription
triggerbooleanfalseWatch this prop — a change to true fires a burst
countnumber80Number of particles
spreadnumber360Spread angle in degrees
durationnumber2500Particle animation duration in ms
colorsstring[]['#ff0000', '#00ff00', ...]Particle colors
origin{ x: number; y: number }{ x: 0.5, y: 0.5 }Burst origin as 0–1 normalized screen coordinates

Private — Jetpack Labs internal use only