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

@static-bolt/waapi

v1.0.0-beta.5

Published

A lightweight wrapper around the Web Animations API.

Downloads

77

Readme

WAAPI (Web Animations API)

A lightweight wrapper around the Web Animations API that makes it easier to animate DOM elements with staggered values, per-element options, and helper utilities.

Installation

npm install @static-bolt/waapi

API

animate(target, options): Animation[]

Animate one or more elements with shared or staggered options.

  • target: Element | Element[] | string
    CSS selector, element, or array of elements.
  • options: AnimateOptions
    Animation settings (duration, easing, cssProps, etc.).

Returns an array of Animation objects.

animateSingle(target, options): Animation

Convenience wrapper for animating a single element.
Accepts the same options as animate, but only returns one animation.

stagger(value, options?): IndexedTransform

Helper for creating staggered values. Returns a function that maps (index, length) → value.

  • value: number to increment/distribute
  • options: StaggerFnOptions

Example:

stagger(100); // 0, 100, 200, 300, ...
stagger(100, { distribute: true }); // 0, 25, 50, 75, 100
stagger(10, { reversed: true }); // reversed order

Types

AnimateOptions

Main configuration object passed to animate.

Key properties:

  • cssProps: object of CSS properties to animate. Supports single values, arrays (multi-step keyframes), and functions (i, ln) => value for per-element control.
  • id: string identifier for the animation
  • delay: ms before start
  • duration: ms per iteration
  • easing: easing function string
  • iterations: repeat count (number or Infinity)
  • loop: shorthand for infinite loop
  • autoplay: start automatically
  • commitStyles: apply final styles to element
  • persist: keep animation from being removed automatically
  • onfinish, oncancel, onremove: event callbacks

Usage Examples

1. Animate a single element

import { animateSingle } from "@static-bolt/waapi";

animateSingle("#box", {
  duration: 1000,
  easing: "ease-in-out",
  cssProps: {
    transform: ["translateX(0px)", "translateX(200px)"],
    opacity: [1, 0.2],
  },
  autoplay: true,
  onfinish: () => console.log("Animation finished!"),
});

2. Animate multiple elements with stagger

import { animate, stagger } from "@static-bolt/waapi";

animate(".item", {
  duration: 800,
  easing: "ease-out",
  cssProps: {
    transform: ["scale(0.5)", "scale(1)"],
  },
  delay: stagger(100),
  autoplay: true,
});

3. Looping spinner

animateSingle("#spinner", {
  duration: 1000,
  easing: "linear",
  loop: true,
  cssProps: {
    transform: ["rotate(0deg)", "rotate(360deg)"],
  },
  autoplay: true,
});

4. Multi-step keyframes with color

animate("#box", {
  duration: 2000,
  easing: "ease-in-out",
  cssProps: {
    transform: ["translateX(0px)", "translateX(200px)", "translateY(100px)", "translateX(0px)"],
    background: ["red", "orange", "yellow", "green"],
  },
  autoplay: true,
});

5. Using stagger template

animate(".bar", {
  duration: 500,
  easing: "ease-out",
  cssProps: {
    transform: ["scaleY(0)", "scaleY(1)"],
    height: stagger(10, { template: "$px" }),
  },
  autoplay: true,
});

License

@static-bolt/waapi library is licensed under The MIT License.