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-scroll-motions

v1.0.1

Published

A collection of high-performance React hooks for parallax scrolling, 3D tilt, magnetic hover, animated counters, and scroll-reveal effects. Lightweight and dependency-free.

Downloads

190

Readme

react-scroll-motions

A collection of high-performance React hooks for parallax scrolling, 3D tilt, magnetic hover, animated counters, and scroll-reveal effects. Lightweight and dependency-free.

npm version license


Features

  • useParallax -- Smooth scroll-based movement for creating depth and layered effects.
  • useTilt -- 3D perspective tilt on hover for cards and interactive elements.
  • useMagneticHover -- Elements that subtly follow the cursor for a premium interactive feel.
  • useCountUp -- Animated number counters that trigger when elements enter the viewport.
  • useScrollReveal -- Efficient entrance animations using IntersectionObserver.
  • Performance Optimized -- Uses requestAnimationFrame and passive event listeners throughout.

Installation

npm install react-scroll-motions

Usage

Parallax Effect

Add data-parallax-speed to any element. The speed value controls how fast the element moves relative to the scroll (0.1 = slow, 0.5 = fast).

import { useParallax } from 'react-scroll-motions';

function HeroSection() {
  useParallax();

  return (
    <section>
      <div data-parallax-speed="0.1">
        <h1>Welcome</h1>
      </div>
      <div data-parallax-speed="0.3">
        <p>Background layer moves at a different speed</p>
      </div>
      <div data-parallax-speed="0.5">
        <img src="/stars.png" alt="Stars" />
      </div>
    </section>
  );
}

3D Tilt Effect

Add data-tilt to any card or interactive element for a perspective-based tilt on hover.

import { useTilt } from 'react-scroll-motions';

function ProjectCard({ title, description }) {
  useTilt();

  return (
    <div data-tilt className="card">
      <h3>{title}</h3>
      <p>{description}</p>
    </div>
  );
}

Magnetic Hover

Add data-magnetic to buttons or links. The element will subtly follow the cursor when hovered.

import { useMagneticHover } from 'react-scroll-motions';

function CallToAction() {
  useMagneticHover();

  return (
    <div>
      <button data-magnetic className="cta-button">
        Get Started
      </button>
      <a data-magnetic href="/docs" className="nav-link">
        Documentation
      </a>
    </div>
  );
}

Count Up Animation

Add data-count-target to number elements. Use data-count-suffix and data-count-prefix for formatting.

import { useCountUp } from 'react-scroll-motions';

function StatsSection() {
  useCountUp();

  return (
    <div className="stats">
      <div>
        <span data-count-target="150" data-count-suffix="+">0</span>
        <p>Projects Completed</p>
      </div>
      <div>
        <span data-count-target="1.6" data-count-suffix="M">0</span>
        <p>Downloads</p>
      </div>
      <div>
        <span data-count-target="99" data-count-suffix="%">0</span>
        <p>Uptime</p>
      </div>
    </div>
  );
}

Scroll Reveal

Add .reveal, .reveal-left, .reveal-right, or .reveal-scale to elements. Define .active styles in your CSS.

import { useScrollReveal } from 'react-scroll-motions';

function AboutSection() {
  useScrollReveal();

  return (
    <section>
      <h2 className="reveal">About Us</h2>
      <p className="reveal-left">We build high-quality software.</p>
      <p className="reveal-right">Our team spans 12 countries.</p>
      <div className="reveal-scale">
        <img src="/team.jpg" alt="Team" />
      </div>
    </section>
  );
}
/* Required CSS for scroll reveal */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transition: all 0.8s ease;
}
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-left.active { opacity: 1; transform: translateX(0); }
.reveal-right.active { opacity: 1; transform: translateX(0); }
.reveal-scale.active { opacity: 1; transform: scale(1); }

.reveal { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.9); }

Combining Multiple Hooks

import {
  useParallax,
  useTilt,
  useMagneticHover,
  useCountUp,
  useScrollReveal
} from 'react-scroll-motions';

function App() {
  useParallax();
  useTilt();
  useMagneticHover();
  useCountUp();
  useScrollReveal();

  return (
    <div>
      {/* All hooks are now active across the entire app */}
    </div>
  );
}

API Reference

| Hook | Data Attribute | Description | | --- | --- | --- | | useParallax() | data-parallax-speed="0.3" | Parallax scroll movement | | useTilt() | data-tilt | 3D perspective tilt on hover | | useMagneticHover() | data-magnetic | Cursor-following hover effect | | useCountUp() | data-count-target="100" | Animated number counter | | useScrollReveal() | .reveal / .reveal-left / .reveal-right / .reveal-scale | Scroll entrance animations |


Browser Support

All modern browsers (Chrome, Firefox, Safari, Edge). Requires IntersectionObserver and requestAnimationFrame.


License

MIT -- see LICENSE for details.