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

@multitrack/react

v0.1.1

Published

React bindings for @multitrack/core

Downloads

222

Readme

@multitrack/react

React bindings for @multitrack/core — a scroll-driven animation engine with a multi-track timeline architecture.

Install

npm install @multitrack/core @multitrack/react

Quick start

import { MultitrackProvider, ScrollContainer, FixedStage, Show, useStep } from "@multitrack/react";
import type { StepConfig } from "@multitrack/core";

const config: StepConfig[] = [
  { name: "intro", duration: 3, track: "main", easing: "linear" },
  { name: "feature", duration: 5, track: "main" },
  { name: "outro", duration: 3, track: "main", easing: "linear" },
];

function App() {
  return (
    <MultitrackProvider config={config}>
      <ScrollContainer>
        <FixedStage>
          <Show when="intro">
            <IntroSection />
          </Show>
          <Show when="feature">
            <FeatureSection />
          </Show>
        </FixedStage>
      </ScrollContainer>
    </MultitrackProvider>
  );
}

function IntroSection() {
  const { opacity } = useStep("intro");
  return (
    <div style={{ opacity, transform: `translateY(${(1 - opacity) * 40}px)` }}>
      <h1>Welcome</h1>
    </div>
  );
}

API

<MultitrackProvider>

Wraps your app and creates the timeline instance. All hooks and components must be used within this provider.

<MultitrackProvider config={config} breakpoints={breakpoints} devtools>
  {children}
</MultitrackProvider>

Hooks

useStep(name)

Returns { opacity, isActive } for a single step. Re-renders only when the step's values change.

useOpacities()

Returns an Opacities record ({ [stepName]: number }) for all steps.

useScrollProgress()

Returns the current scroll progress (0–1).

useTimeline()

Returns the underlying Timeline instance for advanced use cases.

Components

<ScrollContainer>

The scrollable container that drives the timeline. Renders a <div> with the correct scroll height.

<FixedStage>

A fixed-position overlay inside ScrollContainer for content that stays in the viewport while scrolling.

<Show when="stepName">

Conditionally renders children when the named step is active (opacity > 0).

DevTools

Enable the Chrome DevTools integration by passing the devtools prop to the provider:

<MultitrackProvider config={config} devtools>
  {children}
</MultitrackProvider>

This exposes timeline state to the @multitrack/devtools Chrome extension, giving you a live timeline inspector with playhead visualization, active step opacities, and an event log.

Full example with useStep()

For fine-grained control over individual steps, use the useStep() hook to get { opacity, isActive } and drive animations directly:

import { MultitrackProvider, ScrollContainer, FixedStage, Show, useStep } from "@multitrack/react";
import type { StepConfig } from "@multitrack/core";

const config: StepConfig[] = [
  { name: "intro", duration: 3, track: "main", easing: "linear" },
  { name: "feature", duration: 5, track: "main" },
  { name: "outro", duration: 3, track: "main", easing: "linear" },

  // Independent text track — overlaps freely with main
  { name: "buffer", duration: 4, track: "text" },
  { name: "caption", duration: 3, track: "text" },
];

function App() {
  return (
    <MultitrackProvider config={config} devtools>
      <ScrollContainer>
        <FixedStage>
          <Show when="intro">
            <IntroSection />
          </Show>
          <Show when="feature">
            <FeatureSection />
          </Show>
          <Show when="caption">
            <Caption text="Tracks are independent." />
          </Show>
        </FixedStage>
      </ScrollContainer>
    </MultitrackProvider>
  );
}

function IntroSection() {
  const { opacity } = useStep("intro");
  return (
    <div style={{ opacity, transform: `translateY(${(1 - opacity) * 40}px)` }}>
      <h1>Welcome</h1>
    </div>
  );
}

License

MIT