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

next-marquee

v1.0.0

Published

Compositor-driven React marquee built on the Web Animations API. Jank-free runtime speed changes, reverse scrolling, phase-preserving resize, reduced-motion support. SSR-safe, works with Next.js App Router and Pages Router.

Readme

next-marquee

A compositor-driven React marquee built on the Web Animations API. Framework-agnostic — works in any React 18+ app, with first-class support for Next.js (App Router and Pages Router, SSR-safe) and Typescript.

DEMO

Why another marquee?

Most marquee components animate with requestAnimationFrame + per-frame style mutation, which forces style recalculation and re-layerization on the main thread every frame. This one drives a single WAAPI transform animation that runs entirely on the compositor thread — after setup, the main thread does zero work per frame.

  • Jank-free runtime speed changes. Speed is applied via updatePlaybackRate() on a fixed timeline, so changing speed mid-scroll never causes a position jump. Wire it to press-and-hold fast-forward buttons freely.
  • Reverse scrolling. Negative speed plays the marquee backwards, with automatic runway management so backward playback never hits the animation's start and stalls.
  • Seamless looping. The loop distance is measured with sub-pixel precision and includes margins on the content set and gap on the track, so the wrap from one pass to the next is invisible at any content width.
  • Position-preserving resize. When content or container size changes (late-loading fonts or images, responsive breakpoints, live data), the marquee continues from the exact pixel position it was at — no snap back to the start, no jump.
  • Reduced motion. Respects prefers-reduced-motion: reduce automatically, including live changes to the preference.
  • No styling dependency. No CSS import, no Tailwind requirement. Layout is inline; hooks for your own classes are provided.

Install

npm install next-marquee
yarn add next-marquee

TypeScript types are bundled — no separate @types package needed.

Usage

import Marquee from "next-marquee"

export default function Ticker() {
	return (
		<Marquee speed={80} pauseOnHover>
			<span>Breaking news item one</span>
			<span>Breaking news item two</span>
		</Marquee>
	)
}

Even spacing between items, including between the last item of one set and the first item of the next — use the same gap inside each set (className) and between sets (loopClassName):

<Marquee className="gap-8" loopClassName="gap-8">
	{items}
</Marquee>

Press-and-hold scrub buttons:

<Marquee speed={isBackwarding ? -800 : isForwarding ? 800 : 60}>
	{items}
</Marquee>

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | children | ReactNode | — | Content of one marquee set. Duplicated internally to fill the container. | | speed | number | 60 | Pixels per second. Negative values scroll backwards. Changing it at runtime is seamless. | | play | boolean | true | Pauses/resumes the animation, preserving position. | | pauseOnHover | boolean | true | Pause while the pointer is over the marquee. | | loop | number | Infinity | Number of passes (one pass = one content-set width plus its horizontal margins and the track's gap). When finite, the marquee stops at the end and onComplete fires. | | onComplete | () => void | — | Called when a finite loop finishes. | | rootClassName | string | — | Class for the outer clipping container. | | loopClassName | string | — | Class for the moving track. A gap here sets the spacing between content sets. | | className | string | — | Class for each content set. Horizontal margins are included in the loop distance. |

Known limitations

  • Combining a finite loop with negative speed is unsupported: playing backwards to time zero ends the animation. onComplete is guarded against firing in that case, but the marquee will stop.
  • If your forward/backward controls are rendered inside the marquee, pauseOnHover will pause the animation while they're hovered. Place controls outside the component, or disable pauseOnHover while a control is pressed.
  • Duplicated content sets are aria-hidden; interactive elements inside children will appear multiple times in the DOM but only the first set is exposed to assistive technology.

Browser support

Requires Element.animate, Animation.updatePlaybackRate, and ResizeObserver — available in all evergreen browsers. No IE11.

License

MIT