Cool Mode

Add a fun particle effect that follows mouse interactions, with support for emojis, images, and custom shapes.

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/cool-mode.json

Usage

<script lang="ts">	import { CoolMode } from "#lib/components/magic/cool-mode/index.js";</script>
<CoolMode>	<button type="button">Click me</button></CoolMode>

Examples

Custom Image

Props

Cool Mode

A wrapper component that adds particle effects on interaction.

NameTypeDefaultDescription
childrenSnippetrequiredThe content to wrap with cool mode effect
optionsCoolParticleOptionsundefinedConfiguration options for particles

Cool Particle Options

Configuration options for the particle effect.

NameTypeDefaultDescription
particlestring"circle"Particle type: "circle", emoji, or image URL
particleCountnumberundefinedMaximum number of particles
sizenumberrandomSize of particles in pixels
speedHorznumberrandomHorizontal speed of particles
speedUpnumberrandomVertical speed of particles