Particle Logo

How to add a particle logo animation to a Vue 3 app

The Vue export is a single-file component with your logo built in. You can use it as a hero animation or a loading screen and drive it with props.

Updated

What you get

1. Export the component

  1. Open the workbench.
  2. Upload your logo: click to choose a PNG, SVG, JPG or WebP file, drag it onto the page, or paste it with Ctrl+V / ⌘+V. Logos on a transparent or plain background work best; if parts are missing, adjust the sampling density and threshold.
  3. Pick one of the 9 effects and adjust particle size, shape (square or round) and speed.
  4. Click Export Code, open the Vue 3 tab and choose Download File (or copy the code). This format requires Pro.

2. Add it to your app

Save the file as src/components/PixelLogoLoader.vue, then:

<script setup lang="ts">
import PixelLogoLoader from './components/PixelLogoLoader.vue';
</script>

<template>
  <PixelLogoLoader :height="420" />
</template>

By default the component is as wide as its container and 420 px tall. The logo is scaled to fit within 72% of the box and centered. The wrapper has a black background, 16 px rounded corners, a thin border and a shadow; change them in the .pixel-loader-container styles at the bottom of the file.

3. Props

PropTypeDefaultWhat it does
variantstringeffect chosen at exportWhich effect plays; see the values below
widthnumber | string'100%'Numbers are pixels
heightnumber | string420Numbers are pixels
autoPlaybooleantrueLoops the animation: one cycle of duration seconds, then a 1.2 s hold
durationnumber3.2Seconds per cycle
progressnumbernone0 to 100. When set, the animation follows this value instead of playing on its own
colorsstring[]palette chosen at exportParticle colors; points that carry their own color (original colors) keep it
particleSizenumbersize chosen at exportBase particle size, scaled to the container
particleShape'square' | 'circle'shape chosen at exportSquare or round particles
speedMultipliernumberspeed chosen at exportHow fast particles move toward their targets
interactivebooleantrueHover pushes particles away; a click sends a shockwave

Changing variant, colors, particleSize or particleShape re-creates the particles. Values for variant:

variant valueEffect
condenseQuantum Condense
mobius-flowMobius Contour Flow
vortexVortex Singularity
scanHologram Raster Scan
diffusion-denoiseDiffusion Denoise
flux-waveSuperconducting Flux Wave
swarm-assemblyAutonomous Swarm Assembly
gravitational-slingshotSlingshot Time Reversal
cymatics-resonanceCymatics Resonance

4. Use it as a loading screen

With progress set, the particles only move as far as that value, so the logo completes when loading completes:

<script setup lang="ts">
import { ref, onMounted } from 'vue';
import PixelLogoLoader from './components/PixelLogoLoader.vue';

const progress = ref(0);
const ready = ref(false);

onMounted(async () => {
  // Replace these with your own loading steps
  const steps = [() => fetch('/api/user'), () => fetch('/api/projects')];
  for (let i = 0; i < steps.length; i++) {
    await steps[i]();
    progress.value = ((i + 1) / steps.length) * 100;
  }
  ready.value = true;
});
</script>

<template>
  <PixelLogoLoader v-if="!ready" :progress="progress" :height="360" />
  <main v-else>…</main>
</template>

5. Nuxt and server-side rendering

The component only starts drawing in onMounted, so the server renders just its empty container. If your setup still complains during server rendering, wrap it in Nuxt's <ClientOnly>.

6. Performance and accessibility

<script setup lang="ts">
const reduceMotion =
  typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
</script>

<template>
  <PixelLogoLoader :progress="reduceMotion ? 100 : undefined" />
</template>
Open the workbench

More guides