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

gravityjs-animations

v1.0.0

Published

A UI animation and styling framework for making animations behave like real life objects in Earth's gravity

Readme

GravityJS Animations provides two complementary physics systems for the web:

| System | What it does | Entry point | |---|---|---| | UI Components | Spring-animated buttons, cards, accordions, alerts, and more - steered by data-gravity-* attributes | initComponents() | | Gravity Engine | Newtonian falling / bouncing DOM elements with configurable mass, elasticity, and friction | initGravity() / GravityEngine |

No dependencies. Zero configuration required. Works with vanilla HTML and is framework-compatible with React, Vue, and Angular via data-gravity-* attributes.


Table of Contents


Installation

npm

npm install gravityjs-animations

CDN

<script src="https://unpkg.com/gravityjs-animations@latest/dist/gravityjs.umd.js"></script>

When loaded via this UMD bundle, all exports are available on the global window.GravityJS object.

From npm, GravityJS Animations exposes a single 'gravityjs-animations' entrypoint with ESM and CommonJS builds plus bundled TypeScript types; the build is tested to ensure these imports resolve correctly.


Quick Start

Vanilla HTML via CDN

<!DOCTYPE html>
<html>
<body>

  <!-- Physics spring hover on a button -->
  <button data-gravity-button>Hover me</button>

  <!-- Card that lifts on hover with animated shadow -->
  <div data-gravity-card style="padding:24px;border-radius:12px;background:#fff;">
    <h3>Card Title</h3>
    <p>Hover to lift with a spring.</p>
  </div>

  <!-- Accordion with physics open/close -->
  <div data-gravity-accordion>
    <button>What is GravityJS?</button>
    <div class="accordion-content">
      <div>A physics-based animation library for the web applications. Use it in Angular, Vue, React or vanilla HTML.</div>
    </div>
  </div>

	  <script src="https://unpkg.com/gravityjs-animations@latest/dist/gravityjs.umd.js"></script>
  <script>
    GravityJS.initComponents(); // scan DOM and activate all data-gravity-* elements
  </script>

</body>
</html>

Via npm (ESM / TypeScript)

import { initComponents } from 'gravityjs-animations';

// Call once after the DOM is ready - returns a teardown function
const teardown = initComponents();

// Clean up all instances and the MutationObserver (e.g. on SPA route change)
// teardown();

UI Components Overview

See UI Components Reference for the full UI Components documentation.

Gravity Engine

See Gravity Engine for detailed usage.

Framework Integration

See Framework Integration for React, Vue, and Angular examples.

Physics Tuning

See Physics Tuning for tuning recipes.

Material Hints

See Material Hints for material presets.

Advanced Features

See Advanced Features for motion blur, text animation, scoped init, and more.

API Reference

See API Reference for function and type details.

CSS Utilities

See CSS Utilities for stylesheet usage.

Versioning

GravityJS Animations follows Semantic Versioning. The 1.x line indicates that the public gravityjs-animations package and CDN bundle APIs are considered stable: new features and bug fixes in 1.x will not intentionally break the behaviours documented in this README. Breaking changes will be released under a new major version (2.0.0, 3.0.0, ...).

License

MIT © 2026 Andrzej Skowron and GravityJS Animations Contributors (See LICENSE for attribution requirement details.)

Contact

Andrzej Skowron - [email protected]