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-animate-z

v3.0.2

Published

Lightweight React animation library with Animate and AnimateTyping components, built using styled-components.

Readme

🎞️ react-animate-z

NPM Downloads

LIVE EXAMPLE

A lightweight, UX-first animation library for React.

react-animate-z provides a clean imperative + declarative API to orchestrate animations


✨ Why react-animate-z

  • 🚀 180+ prebuilt animations
  • 🧠 Semantic UX states (loading / success / error)
  • ⛓️ Timeline API (sequence, parallel, wait)
  • 🎯 Ref-based animation (no wrapper required)
  • 🎲 Random & playful animation hooks
  • ♿ Reduced-motion safe
  • 🧩 Fully typed with TypeScript

📦 Installation

npm install react-animate-z
# or
yarn add react-animate-z

🚀 Basic Usage (Declarative)

import Animate from "react-animate-z";

export default function App() {
  return (
    <Animate type="bounce" duration="1s">
      <h1>Hello Animation</h1>
    </Animate>
  );
}

🎛️ Animation Catalog

import { animNames, animGroups } from "react-animate-z";

console.log(animNames);   // all animation names
console.log(animGroups); // grouped by category

🔧 Animate Props

| Prop | Type | Default | Description | |-------------|------------------------|-------------|---------------------| | type | AnimateType | blurIn | Animation name | | duration | string \| number | preset map | '1s' or 1000 | | timing | TimingKey | ease | CSS timing function | | delay | string \| number | 0s | Delay before start | | iteration | number \| "infinite" | 1 | Repeat count | | direction | string | normal | Animation direction | | fillMode | string | forwards | CSS fill-mode | | tagName | string | div | Rendered HTML tag |


🎯 Ref-based Animation (Imperative)

import { useAnimate } from "react-animate-z";

function Box() {
  const { ref, play } = useAnimate<HTMLDivElement>();

  return (
    <div ref={ref} onClick={() => play("pulse")}>
      Click me
    </div>
  );
}

⛓️ Timeline API

Compose animations as clear motion flows, not nested callbacks.

import { useAnimate } from "react-animate-z";
import { useEffect } from "react";

function Example() {
  const { ref, sequence } = useAnimate<HTMLDivElement>();

  useEffect(() => {
    sequence()
      .animate("fadeInFromBottom")
      .wait(300)
      .animate("pulse");
  }, []);

  return <div ref={ref}>Hello</div>;
}

🧠 Semantic Recipes (State-driven UX)

import { useRecipe } from "react-animate-z";

function SaveButton() {
  const anim = useRecipe();

  return (
    <button
      ref={anim.ref}
      onClick={async () => {
        anim.loading();
        await save();
        anim.success();
      }}
    >
      Save
    </button>
  );
}

Available presets:

  • loading()
  • success()
  • error()
  • idle()

🔁 — Trigger by State Change

import { AnimateOn } from "react-animate-z";

<AnimateOn when={status} value="success" anim={["fadeIn", "pulse"]}>
  <div>Done!</div>
</AnimateOn>

🧩 AnimateGroup – Staggered Children

import { AnimateGroup } from "react-animate-z";

<AnimateGroup type="fadeInUp" stagger={160}>
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</AnimateGroup>

⌨️ Typing Animation

import { AnimateTyping } from "react-animate-z";

<AnimateTyping
  dataText={[
    "Hello World",
    "React Animate Z",
    "Built for UX",
  ]}
/>

🎲 Random & Playful Motion

import { useRandomAnimateNoRepeat } from "react-animate-z";

const play = useRandomAnimateNoRepeat(run, [
  "shakeMix",
  "pulse",
  "flash",
  "jelly",
]);

<button onClick={() => play()}>Surprise me</button>

🪄 AnimatePresence (Enter / Exit)

AnimatePresence animates mount / unmount using enter / exit animation pairs, similar to Framer Motion but lighter, CSS-based, and no styled-components dependency.

✅ Use case

  • Modal
  • Drawer / Sidebar
  • Toast / Snackbar
  • Tooltip
  • Dropdown
  • Conditional UI

📌 Basic usage

import { AnimatePresence } from "react-animate-z";

function Example({ open }: { open: boolean }) {
  return (
    <AnimatePresence
      show={open}
      enter="fadeIn"
      exit="fadeOut"
      duration={300}
    >
      <div>Hello</div>
    </AnimatePresence>
  );
}

🔥 Example: Modal

<AnimatePresence
  show={open}
  enter="zoomIn"
  exit="fadeOut"
  duration={250}
>
  <div className="modal" />
</AnimatePresence>

🧠 Behavior timeline

show = false
  └─ nothing rendered

show = true
  └─ mount
      └─ enter animation

show = false
  └─ exit animation
      └─ wait(duration)
          └─ unmount
  • Declarative intent, not keyframes
  • Timeline-based composition
  • Ref-first, framework-agnostic core
  • Safe defaults for accessibility

🧩 Additional APIs

Components

  • AnimateHost: Low-level animation context host, used for coordinating multiple animated elements.
  • WrapperAnimate: Conditional animation wrapper without breaking DOM structure.
  • TypingText: Lightweight typing animation for inline text (simpler than AnimateTyping).

Hooks

  • useAnimateController: Imperative control over animation lifecycle (play, stop, reset).
  • useAnimateSequence: Timeline logic as a hook for reusable animation flows.
  • useRandomAnimateNoRepeat: Random animation helper with no immediate repetition.
  • useRecipe: Semantic, state-driven animation (loading, success, error).

These APIs are intended for advanced or compositional use cases. Most applications only need and useAnimate().


📜 License

MIT