Skip to content
Backgrounds Fancy Stable

Sparkles

.md

Canvas-based floating particle sparkle effect with configurable density and colors

Available for Svelte 5, React, and Vue 3.

Preview

Installation

pnpm add fancy-ui-svelte
import { Sparkles } from "fancy-ui-svelte";

Usage

svelte
<script lang="ts">
  import { Sparkles } from 'fancy-ui-svelte';
</script>

<Sparkles background="#0b1020" particleColor="currentColor" particleDensity={160} class="text-white" />

Examples

Basic Usage

Custom Colors

Dense & Fast

More particles, faster speed.

Props

PropTypeDefaultDescription
background string"#0d47a1"Background color of the canvas container
particleColor string"#ffffff"Color of the particles: a hex string, or currentColor to follow the text colour
minSize number1Minimum particle radius in pixels
maxSize number3Maximum particle radius in pixels
speed number4Particle speed multiplier
particleDensity number120Number of particles