npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

burst-particles

v1.0.3

Published

Physics-based particle bursts for web apps. 15+ premium presets, fractal shapes, and emoji support. Zero dependencies and buttery smooth 60FPS.

Downloads

67

Readme

burst-particles

Physics-based particle bursts for the web. Zero dependencies. One function call.

NPM Version Bundle Size License: MIT TypeScript

▶ Live Demo · npm · GitHub


import { burst } from 'burst-particles';

button.addEventListener('click', (e) => burst(e, 'party'));

That's it. A canvas is created, animated, and cleaned up automatically.


Installation

npm install burst-particles
# or
pnpm add burst-particles
# or
yarn add burst-particles

Usage

Vanilla JS

import { burst } from 'burst-particles';

document.getElementById('btn').addEventListener('click', (e) => {
  burst(e, 'party');
});

React

import { burst } from 'burst-particles';

function LikeButton() {
  return (
    <button onClick={(e) => burst(e, 'hearts')}>
      ❤️ Like
    </button>
  );
}

Fixed position

burst({ x: window.innerWidth / 2, y: 200 }, 'stars');

Stack multiple effects

const fire = (e) => {
  burst(e, 'stars');
  burst(e, 'gold');
};

Presets

| Preset | Description | |---|---| | party | Multicolored confetti explosion | | fire | Rising embers and flames | | snow | Drifting snowflakes | | hearts | Floating pink hearts | | stars | Spinning golden stars | | bubbles | Soft floating rings | | explode | Fast sharp shrapnel burst | | rain | Falling blue droplets | | gold | Shiny golden coins and stars | | sakura | Gentle cherry blossom petals | | electric | Jagged blue lightning sparks | | neon | Vibrant neon shapes | | flowers | Blooming flower petals | | smoke | Rising grey smoke clouds | | laugh | Flying laughing emojis 😂🤣 |


API

burst(origin, preset?)

| Parameter | Type | Description | |---|---|---| | origin | MouseEvent \| PointerEvent \| { x: number; y: number } | Where the burst spawns | | preset | ParticlePreset \| PresetConfig | Built-in preset name or custom config object |

preset defaults to "party".


Custom Effects

Pass a PresetConfig object to build your own effect from scratch:

import { burst, type PresetConfig } from 'burst-particles';

const goldRain: PresetConfig = {
  count: 60,
  shapes: ['star', 'circle'],
  colors: ['#FFD700', '#FDB931', '#fff'],
  spread: Math.PI * 2,
  speedMin: 3,
  speedMax: 8,
  gravity: 0.2,
  drag: 0.98,
  sizeMin: 6,
  sizeMax: 14,
  lifeMin: 100,
  lifeMax: 180,
  rotates: true,
  fadeOut: true,
  drift: 0.05,
  riseInit: -1,
};

burst(e, goldRain);

Emoji / character particles

Add a chars array to use emojis or text as particles:

burst(e, {
  count: 20,
  shapes: [],
  chars: ['🚀', '⭐', '✨'],
  colors: [],
  spread: Math.PI * 2,
  speedMin: 3, speedMax: 7,
  gravity: 0.2, drag: 0.98,
  sizeMin: 20, sizeMax: 36,
  lifeMin: 80, lifeMax: 130,
  rotates: true, fadeOut: true,
  drift: 0, riseInit: -1,
});

PresetConfig reference

| Property | Type | Description | |---|---|---| | count | number | Number of particles per burst | | shapes | Shape[] | rect circle triangle heart star ring line flower snowflake smoke | | chars | string[] | Emojis or characters to use as particles (optional) | | colors | string[] | Hex colors, chosen randomly per particle | | spread | number | Explosion arc in radians (Math.PI * 2 = full circle) | | spreadDir | number | Direction of the arc in radians (default 0) | | speedMin | number | Minimum launch speed | | speedMax | number | Maximum launch speed | | gravity | number | Downward pull per frame (negative = upward) | | drag | number | Velocity multiplier per frame (0.98 = natural slowdown) | | drift | number | Random horizontal sway per frame | | riseInit | number | Initial upward velocity offset | | sizeMin | number | Minimum particle size in px | | sizeMax | number | Maximum particle size in px | | lifeMin | number | Minimum lifetime in frames | | lifeMax | number | Maximum lifetime in frames | | rotates | boolean | Enable particle rotation | | fadeOut | boolean | Fade out near end of life |


How it works

On first call, a single <canvas> is injected into document.body at z-index: 9999 with pointer-events: none. It resizes with the window. The canvas is shared across all concurrent bursts and the requestAnimationFrame loop stops automatically when all particles have expired — no timers or cleanup needed.

Complex shapes (flower, snowflake, smoke) and emoji characters are pre-rendered to off-screen canvases and cached, so each frame only calls drawImage for them.


License

MIT © K.Prabhasha