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

@mihirsarya/manim-scroll

v0.2.2

Published

Unified package for scroll-driven Manim animations - includes runtime, React components, and Next.js plugin.

Downloads

71

Readme

@mihirsarya/manim-scroll

Unified package for scroll-driven Manim animations. Pre-render mathematical animations with Manim and play them back smoothly as users scroll.

This is the recommended package for most users—it re-exports everything from the runtime, React, and Next.js packages.

Installation

npm install @mihirsarya/manim-scroll

Requirements

  • React 18+
  • Next.js 13+ (for the build plugin)
  • Python 3.8+ with Manim installed

Quick Start

1. Configure Next.js

// next.config.js
const { withManimScroll } = require("@mihirsarya/manim-scroll/next");

module.exports = withManimScroll({
  manimScroll: {
    pythonPath: "python3",
    quality: "h",
  },
});

2. Use the Component

import { ManimScroll } from "@mihirsarya/manim-scroll";

export default function Page() {
  return (
    <ManimScroll
      scene="TextScene"
      fontSize={72}
      color="#ffffff"
      scrollRange="viewport"
    >
      Welcome to my site
    </ManimScroll>
  );
}

The plugin automatically scans your source files, extracts <ManimScroll> components, and renders animations at build time with smart caching.

Exports

From the main entry (@mihirsarya/manim-scroll)

React Components & Hooks:

  • ManimScroll - Scroll-driven animation component
  • useManimScroll - Hook for custom integrations with pre-rendered assets
  • useNativeAnimation - Hook for native SVG text animation

Runtime:

  • registerScrollAnimation - Register scroll animation (vanilla JS)
  • registerNativeAnimation - Register native text animation (vanilla JS)
  • NativeTextPlayer - Native text animation player class

Types:

  • ManimScrollProps, ManimAnimationProps
  • UseManimScrollOptions, UseManimScrollResult
  • UseNativeAnimationOptions, UseNativeAnimationResult
  • RenderManifest, ScrollAnimationOptions, ScrollRange, ScrollRangePreset, ScrollRangeValue
  • NativeAnimationOptions

From Next.js entry (@mihirsarya/manim-scroll/next)

  • withManimScroll - Next.js config wrapper
  • ManimScrollConfig - Configuration type
  • extractAnimations - Extract animations from source files
  • renderAnimations - Render animations with Manim CLI
  • computePropsHash, isCached, getCacheEntry, etc.

Component Props

| Prop | Type | Description | |------|------|-------------| | scene | string | Scene name (default: "TextScene") | | fontSize | number | Font size for text animations | | color | string | Color as hex string (e.g., "#ffffff") | | font | string | Font family for text | | inline | boolean | Enable inline mode for text that flows with content | | mode | "auto" \| "video" \| "frames" \| "native" | Playback mode | | scrollRange | ScrollRangeValue | Scroll range configuration | | manifestUrl | string | Explicit manifest URL (overrides auto-resolution) | | onReady | () => void | Called when animation is loaded | | onProgress | (progress: number) => void | Called on scroll progress | | children | ReactNode | Text content for the animation |

Scroll Range Configuration

// Presets
<ManimScroll scrollRange="viewport">...</ManimScroll>
<ManimScroll scrollRange="element">...</ManimScroll>
<ManimScroll scrollRange="full">...</ManimScroll>

// Relative units
<ManimScroll scrollRange={["100vh", "-50%"]}>...</ManimScroll>

// Pixel values
<ManimScroll scrollRange={[800, -400]}>...</ManimScroll>

Next.js Plugin Options

| Option | Default | Description | |--------|---------|-------------| | pythonPath | "python3" | Path to Python executable | | quality | "h" | Manim quality preset (l, m, h, k) | | fps | 30 | Frames per second | | resolution | "1920x1080" | Output resolution | | format | "both" | Output format (frames, video, both) | | concurrency | CPU count - 1 | Max parallel renders | | verbose | false | Enable verbose logging | | cleanOrphans | true | Remove unused cached assets |

Native Mode

For text animations without pre-rendered assets, use native mode:

<ManimScroll mode="native" fontSize={48} color="#ffffff">
  Animate this text
</ManimScroll>

Native mode renders directly in the browser using SVG, replicating Manim's Write/DrawBorderThenFill effect.

Related Packages

| Package | npm | Description | |---------|-----|-------------| | @mihirsarya/manim-scroll-react | React component and hooks | | @mihirsarya/manim-scroll-next | Next.js build plugin | | @mihirsarya/manim-scroll-runtime | Core scroll runtime |

License

MIT