Vue 3 Recipe • Production Motion Pattern

Vue Confetti: Hardware-Accelerated Particle Physics in Vue 3

Adding festive celebration effects like confetti bursts to user milestones, purchase confirmations, and form submissions adds immense delight to web applications. However, traditional JavaScript and Vue confetti packages flood the browser DOM with hundreds of individual div tags or SVG nodes, causing immediate composite lag, frame drops, and fan spin on laptop devices. ExodeUI changes the game by executing particle physics simulations directly inside a WebGL compute pass. You can fire thousands of dynamic confetti fragments—complete with realistic air resistance, gravity, flutter, and rotational drag—triggered with a single Vue reactive ref without slowing down the user interface.

Vue 3 Live Interactive Stage
exodeui-vue

Bursts Triggered: 0

Instanced WebGL Compute Pass
Under the Hood: Vue 3 Reactivity & WebGL Pipeline

ExodeUI for Vue connects Vue 3 reactive ref and computed primitives directly to GPU uniform registers and state machines, eliminating Virtual DOM recalculation overhead and guaranteeing consistent 120fps motion.

Runnable ExodeUI Vue 3 Code Example

Vue 3 SFC Composition API

Import the ExodeUICanvas component and bind reactive parameters declaratively without imperative DOM lifecycle hooks:

html
<template>
  <div class="confetti-showcase">
    <button @click="triggerCelebration" class="celebrate-btn">
      🎉 Trigger Confetti Burst
    </button>

    <ExodeUICanvas
      ref="canvasRef"
      src="/scenes/vue-confetti-burst.json"
      :inputs="{
        'burstTrigger': burstCount,
        'particleVelocity': 1.2,
        'gravity': 0.98
      }"
      class="confetti-canvas"
    />
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { ExodeUICanvas } from 'exodeui-vue';

const burstCount = ref(0);
const canvasRef = ref(null);

const triggerCelebration = () => {
  burstCount.value += 1;
  // Canvas automatically listens to input increments and spawns 500+ particles
};
</script>

<style scoped>
.confetti-showcase {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}
.confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.celebrate-btn {
  position: relative;
  z-index: 10;
}
</style>

Frequently Asked Questions about vue confetti

Why is ExodeUI confetti faster than canvas-confetti or DOM confetti?

Standard confetti libraries calculate particle positions on the main CPU thread and draw each fragment iteratively. ExodeUI uses instanced GPU draw calls with WebAssembly rigid body physics.

Can I customize the confetti particle colors to match our brand?

Yes. ExodeUI scenes accept palette arrays and custom vector SVGs as particle textures, allowing branded stars, emojis, ribbon strips, and logos.

Does the confetti effect automatically clean up after falling?

Yes. ExodeUI automatically culls off-screen particles and pauses the WebGL render loop when particles settle, preserving battery life and CPU cycles.

Explore Related Vue Recipes & Documentation Hubs