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-anim-fast

v0.1.1

Published

Lightweight CSS-driven micro-animations for React UI states

Readme

react-anim-fast

Lightweight CSS-driven UI animations with a small React helper API.

Install

npm install react-anim-fast

Import the CSS once in your app entry:

import "react-anim-fast/styles.css";

Then use the React helpers or the exported class maps:

import { Animated, CONTINUOUS, ONE_SHOTS, animationClassName } from "react-anim-fast";

export function Example({ saving }: { saving: boolean }) {
  return (
    <>
      <Animated as="span" loop="spin" aria-hidden>
        *
      </Animated>

      <Animated oneShot="fadeInUp" trigger={saving}>
        Saved
      </Animated>

      <div className={CONTINUOUS.pulse}>Live</div>
      <div className={ONE_SHOTS.flash}>Highlighted once on mount</div>
      <div className={animationClassName({ className: "badge", loop: "blink" })}>
        Alert
      </div>
    </>
  );
}

Animation Catalog

One-shot animations:

| Name | Class | | --- | --- | | shake | anim-shake | | blink | anim-blink | | flash | anim-flash | | fadeIn | anim-fade-in | | fadeInUp | anim-fade-in-up | | fadeInDown | anim-fade-in-down | | fadeInLeft | anim-fade-in-left | | fadeInRight | anim-fade-in-right | | fadeOut | anim-fade-out | | fadeOutUp | anim-fade-out-up | | fadeOutDown | anim-fade-out-down | | fadeOutLeft | anim-fade-out-left | | fadeOutRight | anim-fade-out-right |

Continuous animations:

| Name | Class | | --- | --- | | spin | anim-spin | | marquee | anim-marquee | | marqueeReverse | anim-marquee-reverse | | blink | anim-blink-loop | | pulse | anim-pulse | | glow | anim-banner-glow |

Helper classes:

| Name | Class | | --- | --- | | marqueeViewport | anim-marquee-viewport |

For non-React usage, use the maps directly or animationClassName:

import { animationClassName } from "react-anim-fast";

const className = animationClassName({
  className: "status",
  oneShot: "fadeInRight",
  loop: "pulse",
});

React API

Animated renders a DOM element, merges animation classes with your className, and replays one-shot animations whenever trigger becomes truthy.

<Animated as="button" oneShot="blink" trigger={errorCount}>
  Retry
</Animated>

<Animated as="span" loop="pulse">
  Recording
</Animated>

For fade-out exit flows, keep the class on the element until you unmount it:

<Animated
  oneShot="fadeOutLeft"
  trigger={closing}
  persistOneShotClass
  onAnimationEnd={() => setMounted(false)}
>
  Closing panel
</Animated>

useOneShot is available when you need to attach the replay behavior to your own component.

import { useEffect } from "react";
import { useOneShot } from "react-anim-fast";

function SaveButton({ saved }: { saved: boolean }) {
  const { ref, trigger, className } = useOneShot<HTMLButtonElement>();

  useEffect(() => {
    if (saved) trigger("flash");
  }, [saved, trigger]);

  return (
    <button ref={ref} className={className}>
      Save
    </button>
  );
}

Marquee

Wrap marquee content in anim-marquee-viewport so overflowing text is clipped:

import { CONTINUOUS, HELPERS } from "react-anim-fast";

<div className={HELPERS.marqueeViewport}>
  <span className={CONTINUOUS.marquee}>System status updates</span>
</div>;

Tuning

The CSS uses custom properties so animations can be tuned per element:

import type { CSSProperties } from "react";

<Animated
  loop="spin"
  style={{
    "--anim-duration": "700ms",
    "--anim-origin": "center",
  } as CSSProperties}
>
  *
</Animated>

Common variables:

| Variable | Default | | --- | --- | | --anim-duration | depends on animation | | --anim-delay | 0s | | --anim-easing | depends on animation | | --anim-distance | 1rem | | --anim-scale | 1.04 | | --anim-min-opacity | 0.18 | | --anim-marquee-start | 100% | | --anim-marquee-end | -100% |

Directional fade names follow common UI semantics: fadeInLeft enters from the left, while fadeOutLeft exits toward the left.