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

infinite-react-marquee

v1.0.5

Published

GPU-accelerated, zero-dependency infinite scrolling marquee component for React.

Readme

Most marquee libraries rely on hacky CSS keyframes, heavy physics engines, or cloned DOM thrashing. Infinite React Marquee is explicitly engineered for production edge-cases and raw performance.

It utilizes a precision requestAnimationFrame engine combined with CSS 3D transforms (translate3d) to deliver 120fps smooth scrolling with zero layout shift. It automatically handles complex DOM scenarios like RTL directionality, battery-saving off-screen pausing, and OS-level accessibility preferences.

🎬 Live Demo

Try it now: galbenyosef.github.io/infinite-react-marquee

Source code: github.com/galbenyosef/infinite-react-marquee

The demo site includes:

  • Landing showcase — feature cards, brand logo strip, testimonial ticker, vertical scrolling
  • Interactive playground — tweak speed, direction, fade edges, RTL, pause-on-hover/press in real time
  • Drag to scroll — click and swipe the marquee like a carousel

Run the demo locally:

git clone https://github.com/galbenyosef/infinite-react-marquee.git
cd infinite-react-marquee
npm install
npm run dev

✨ Key Features

  • 🏎️ GPU-Accelerated: Direct DOM translation bypassing the React render cycle. Buttery smooth 60hz/120hz output.
  • 🔋 Battery Saver (IntersectionObserver): Automatically halts the compute loop entirely when scrolled out of the viewport.
  • 🌍 Bulletproof RTL: Safely clamps local directionality. Will not break, overflow, or gap in global dir="rtl" documents (e.g., Arabic, Hebrew).
  • 🎛️ Native Swipe & Drag: Fully interactive. Evaluates native PointerEvents to let users manually drag/swipe the marquee like a carousel.
  • 🎭 Native Edge Masks: Generates CSS mask-image linear gradients for perfect fade-outs that don't rely on solid color overlay DOM node hacks. Lets complex CSS backgrounds show through perfectly.
  • ♿ Auto-Accessibility: Automatically respects OS-level prefers-reduced-motion media queries and stops movement for motion-sensitive users.
  • 📦 Zero Dependencies: Tiny ~1.5kb footprint. SSR-ready. Works perfectly with Next.js, Remix, Vite, and Tailwind CSS.

📦 Installation

npm install infinite-react-marquee
# or
yarn add infinite-react-marquee
# or
pnpm add infinite-react-marquee

🚀 Quick Start

import { InfiniteMarquee } from 'infinite-react-marquee';

function App() {
  return (
    <div style={{ height: "100vh", width: "100%" }}>
      <InfiniteMarquee 
        speed={50} 
        direction="left" 
        gap="2rem" 
        pauseOnHover={true}
      >
        <div className="card">Brand Logo 1</div>
        <div className="card">Brand Logo 2</div>
        <div className="card">Brand Logo 3</div>
        <div className="card">Brand Logo 4</div>
      </InfiniteMarquee>
    </div>
  );
}

export default App;

🧠 Advanced Usage (Fade Edges & Dragging)

<InfiniteMarquee
  speed={80}
  direction="right"
  pauseOnHover={false}
  pauseOnPress={true} // Enables Swipe & Drag interactions
  fadeEdges={true}    // Enables native CSS mask fading at the edges
  fadeWidth="15%"     // Customize the width of the edge fade
  className="my-custom-wrapper-class"
>
  <img src="/sponsor-1.svg" alt="Sponsor" />
  <img src="/sponsor-2.svg" alt="Sponsor" />
</InfiniteMarquee>

🎛️ API Reference / Props

| Prop | Type | Default | Description | | ---- | ---- | ------- | ----------- | | speed | number | 50 | Animation speed in pixels per second. Adjust for reading comfort. | | direction | 'left' \| 'right' \| 'up' \| 'down' | 'left' | The direction the content flows. Automatically determines horizontal vs vertical scrolling. | | playing | boolean | true | Programmatically control whether the animation plays or is paused. | | gap | string | '1rem' | CSS string (e.g. 20px, 2rem) for the gap between repeating chunk sets. | | fadeEdges | boolean | false | Dynamically applies a CSS gradient mask to seamlessly fade the start and end edges. | | fadeWidth | string \| number | '5rem' | The width/size of the fading edge mask (e.g., 100px, 15%). | | pauseOnHover | boolean | true | Pauses the scrolling animation temporarily when a user hovers their mouse over the container. | | pauseOnPress | boolean | true | Pauses while the mouse is clicked or screen touched. Combined with pointer events, this enables native drag/swipe interaction. | | rtl | boolean | false | Explicit configuration for right-to-left layout synchronization if needed. Note: The component handles global RTL protection automatically via internal clamping. | | className | string | '' | Classes applied to the outermost wrapper container. Useful for setting overall width/height or Tailwind utility classes. | | innerClassName | string | '' | Classes applied directly to the internal repeating track container. |


🥊 Feature Comparison

How Infinite React Marquee stacks up against common approaches — without naming names.

| Feature | Infinite React Marquee | CSS-based alternatives | Animation physics libraries | | ------- | ---------------------- | ---------------------- | --------------------------- | | Interactive swipe / drag | ✅ Native & seamless | ❌ Not supported | ✅ Supported (heavy) | | Global RTL support | ✅ Bulletproof math | ❌ Broken alignment | ⚠️ Requires config | | Off-screen pausing | ✅ Auto (IntersectionObserver) | ❌ Runs off-screen | ⚠️ Manual config | | Reduced motion (a11y) | ✅ Auto-detected | ⚠️ Requires CSS / prop | ⚠️ Partial native | | Edge fading | ✅ Native CSS mask | ⚠️ Overlay gradients | ❌ Extra CSS required | | Animation engine | rAF + direct DOM | CSS keyframes | Complex physics rAF | | Bundle size | < 2kb | ~3–4kb | > 30kb |

Why it matters in production:

  • Gestures / dragging — CSS-only marquees can't support drag without unpredictable layout resets. We translate via pure DOM matrix transforms.
  • RTL safety — Global dir="rtl" breaks marquees that assume left-alignment. We clamp internal layout to LTR and recalculate widths securely.
  • Battery drain — CSS animations keep running off-screen. We halt the compute loop when nothing is watching.
  • Bundle weight — Physics animation libraries are powerful, but overkill for a scrolling banner. This ships in under 2kb.

🤝 Contributing

Contributions are welcome! Open issues and PRs on the GitHub repository.

git clone https://github.com/galbenyosef/infinite-react-marquee.git
cd infinite-react-marquee
npm install
npm run dev      # demo site
npm test         # unit tests
npm run build:lib # library build

🏷️ Keywords

react, marquee, infinite scroll, slider, ticker, carousel, continuous scrolling, auto scroll, react marquee, react ticker, tailwind marquee, nextjs marquee, rtl marquee, accessible marquee, swipeable marquee, draggable marquee, gpu-accelerated.

License

MIT © galbenyosef