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

loadingaicon

v0.2.0

Published

Drop-in React component for transparent AI-generated loading animations

Readme

loadingaicon

Drop-in React component for transparent AI-generated loading animations (WebM with alpha).

Install

npm install loadingaicon

Usage

import { LoadingIcon } from "loadingaicon";

function App() {
  return (
    <LoadingIcon
      src="/animations/jellyfish-transparent.webm"
      width={200}
      height={200}
    />
  );
}

Next.js (App Router)

Works out of the box — the component is SSR-safe and hydrates on the client.

// app/loading.tsx
import { LoadingIcon } from "loadingaicon";

export default function Loading() {
  return (
    <div style={{ display: "flex", justifyContent: "center", padding: 80 }}>
      <LoadingIcon src="/animations/spinner.webm" width={160} height={160} />
    </div>
  );
}

Safari Fallback

Safari doesn't support WebM with alpha. Provide a fallback prop (GIF, APNG, or static image):

<LoadingIcon
  src="/animations/spinner.webm"
  fallback="/animations/spinner.gif"
  width={120}
  height={120}
/>

If no fallback is provided, a minimal CSS spinner renders automatically.

Customization

<LoadingIcon
  src="/animations/spinner.webm"
  width={200}
  height={200}
  speed={1.5}
  borderRadius={16}
  background="rgba(0,0,0,0.05)"
  opacity={0.9}
  filter="hue-rotate(90deg)"
  objectFit="cover"
  loop={false}
  onEnd={() => console.log("done")}
  onClick={() => console.log("clicked")}
/>

Props

| Prop | Type | Default | Description | | -------------- | --------------------------------- | ----------- | -------------------------------------------------- | | src | string | (required) | URL to the transparent .webm video | | fallback | string | — | Fallback image URL for non-WebM browsers | | width | number \| string | 120 | Width in px or CSS value | | height | number \| string | 120 | Height in px or CSS value | | className | string | — | CSS class on the container | | style | CSSProperties | — | Inline styles on the container | | alt | string | "Loading" | Accessible label (aria-label) | | speed | number | 1 | Playback speed (0.5 = half, 2 = double) | | paused | boolean | false | Pause the animation | | loop | boolean | true | Whether the animation loops | | objectFit | "contain" \| "cover" \| "fill" | "contain" | How the video fits the container | | borderRadius | number \| string | — | Border radius on the container | | background | string | — | Background color/value on the container | | opacity | number | — | Opacity of the container (0–1) | | filter | string | — | CSS filter on the video ("grayscale(1)", etc.) | | onClick | MouseEventHandler | — | Click handler on the container | | onLoop | () => void | — | Fires each time the animation loops (loop=true) | | onEnd | () => void | — | Fires when the animation ends (loop=false) |

Exports

// Component
import { LoadingIcon } from "loadingaicon";

// Hook — check if current browser supports WebM alpha
import { useWebmSupport } from "loadingaicon";

// Types
import type { LoadingIconProps } from "loadingaicon";