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

@iampoul/react-parallax

v0.7.0

Published

A performant, accessible React parallax component with scroll and pointer-based motion

Readme

@iampoul/react-parallax

react-parallax.dev · npm · GitHub

A performant, accessible React parallax component with scroll and pointer-based motion.

Installation

npm install @iampoul/react-parallax

Usage

import { Parallax, ParallaxLayer } from "@iampoul/react-parallax"

function App() {
  return (
    <Parallax mode="both" intensity={1} smoothing={0.12}>
      {/* Background layer - moves slower, appears further */}
      <ParallaxLayer speed={0.5} pointerStrength={20}>
        <img src="/background.png" alt="" />
      </ParallaxLayer>

      {/* Foreground layer - moves faster, appears closer */}
      <ParallaxLayer speed={-0.3} pointerStrength={40} zIndex={1}>
        <img src="/foreground.png" alt="" />
      </ParallaxLayer>
    </Parallax>
  )
}

Horizontal parallax

For side-scrolling layouts, pass direction="horizontal" to drive scroll progress from the horizontal axis. Set axis="x" on layers so they translate along the same direction as the scroll.

const wrapperRef = useRef<HTMLDivElement>(null)

<div ref={wrapperRef} style={{ overflowX: "scroll", display: "flex" }}>
  <Parallax
    direction="horizontal"
    mode="scroll"
    scrollParent={wrapperRef.current}
    overflow="visible"
    style={{ width: "300vw", height: "100vh" }}
  >
    <ParallaxLayer speed={0.4} axis="x">
      <img src="/clouds.png" alt="" />
    </ParallaxLayer>
    <ParallaxLayer speed={0.8} axis="x" zIndex={1}>
      <img src="/mountains.png" alt="" />
    </ParallaxLayer>
  </Parallax>
</div>

API

<Parallax>

The container that tracks scroll + pointer motion and broadcasts it to child layers.

| Prop | Type | Default | Description | |------|------|---------|-------------| | mode | "scroll" \| "pointer" \| "both" | "both" | Which inputs drive the parallax effect | | direction | "vertical" \| "horizontal" | "vertical" | Scroll axis that drives progress. Use "horizontal" for side-scrolling layouts — pairs with axis="x" on layers | | intensity | number | 1 | Global movement multiplier (0.5 = subtle, 2 = dramatic) | | smoothing | number | 0.12 | Easing factor (lower = floatier, 1 = instant). Ignored when springConfig is set | | springConfig | { stiffness?: number; damping?: number } | – | Spring physics alternative to lerp — gives natural overshoot. stiffness default 120, damping default 14 | | onProgress | (state: ParallaxState) => void | – | Callback fired every frame with current scroll/pointer state | | disabled | boolean | false | Pause all motion (auto-enabled for reduced-motion) | | scrollParent | HTMLElement \| null | window | Custom scroll container — use when <Parallax> is inside a scrollable div, modal, or sidebar | | overflow | string | "hidden" | CSS overflow on the container — set to "visible" to let layers bleed outside bounds | | as | ElementType | "div" | HTML element to render | | className | string | – | CSS class for the container | | style | CSSProperties | – | Inline styles |

<ParallaxLayer>

A single moving object inside a <Parallax> container.

| Prop | Type | Default | Description | |------|------|---------|-------------| | speed | number | 0.3 | Depth: 0 = locked, >0 = slower/background, <0 = faster/foreground | | pointerStrength | number | 0 | Pixels of travel from pointer movement | | scrollRange | number \| string | 120 | Max scroll travel — absolute px or "25%" of container height | | axis | "x" \| "y" \| "both" | "y" | Axis for scroll parallax | | rotate | number | 0 | Degrees of rotation across scroll range | | scale | number | 0 | Extra scale at scroll edges (0.2 = +20%) | | fade | number | 1 | Opacity at edges (1 = no fade) | | blur | number | 0 | Max blur in px at scroll edges, 0 at center — creates a depth-of-field focus effect | | blurBase | number | 0 | Constant blur in px always applied — use for layers that should always appear out of focus | | zIndex | number | 0 | Stacking order | | as | ElementType | "div" | HTML element to render | | className | string | – | CSS class | | style | CSSProperties | – | Inline styles |

useParallax()

Hook to access the parallax context from custom components.

const { intensity, disabled, mode, subscribe, getState } = useParallax()

Features

  • Zero dependencies (only React peer dependency)
  • Performant - Single rAF loop, ref-based subscriptions, no React re-renders
  • Accessible - Respects prefers-reduced-motion
  • Flexible - Scroll, pointer, or both; customize speed, rotation, scale, fade
  • TypeScript - Full type definitions included

License

MIT