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

react-thanos-effect

v1.0.2

Published

Thanos-style dust disintegration effect for React — OffscreenCanvas, Web Worker, WASM, and WebGL2 instancing.

Readme

react-thanos-effect

Thanos-style dust disintegration for React. Captures children, then dissolves them with WebGL2 instanced particles on an OffscreenCanvas inside a Web Worker. Simulation runs in WebAssembly.

Install

npm install react-thanos-effect

Peer dependencies: react and react-dom ≥ 18.

Usage

import { useRef } from "react";
import ThanosEffect, {
  type EffectTriggerHandle,
  type AnimationMode,
} from "react-thanos-effect";
import "react-thanos-effect/style.css";

function Example() {
  const ref = useRef<EffectTriggerHandle>(null);

  return (
    <>
      <ThanosEffect ref={ref} duration={500} particleSize={2} animationMode="wave">
        <img src="/your-image.png" alt="target" />
      </ThanosEffect>

      <button onClick={() => ref.current?.trigger()}>Snap</button>
    </>
  );
}

Props

| Prop | Default | Description | | --- | --- | --- | | animationMode | "wave" | wave, explosion, spiral, vortex, scatter, rain | | duration | 500 | Animation duration (ms) | | density | 1 | Particle density | | particleSize | 2 | Particle size (px) | | riseFactor | 0.2 | Rise amount (used by wave) | | spawnBandPx | 0 | Spawn lead distance | | useCORS | true | Prefer CORS when embedding images | | backgroundColor | null | Capture background | | className / style | — | Wrapper styles |

Call ref.current.trigger() to start the effect.

Animation modes

import { ANIMATION_MODES, DEFAULT_ANIMATION_MODE } from "react-thanos-effect";

Vite tip

If the worker fails to load in vite dev, exclude the package from prebundling:

// vite.config.ts
export default defineConfig({
  optimizeDeps: {
    exclude: ["react-thanos-effect"],
  },
});

Also import the stylesheet: import "react-thanos-effect/style.css".

Browser support

Requires OffscreenCanvas, Worker, and WebGL2.

Complex children (not a single <img> / <canvas> / <video>) are painted onto a clean canvas so the bitmap can be transferred to the worker. Prefer same-origin or CORS-enabled images in CSS background-image and <img>.

License

MIT