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

@scenar/react

v0.1.19

Published

React components and hooks for the Scenar scenario playback engine.

Readme

@scenar/react

React components and hooks for the Scenar scenario playback engine. Build interactive web embeds and pixel-perfect video from the same scenario source.

Install

pnpm add @scenar/react @scenar/core

Peer dependencies

  • react >= 18
  • react-dom >= 18
  • framer-motion >= 11
  • lucide-react >= 0.400 (optional — only needed if you use the built-in control icons)

Styling

The package ships two CSS files. Choose the one that matches your setup.

Option A: Self-contained (no Tailwind required)

Import styles.css — a pre-built bundle containing every utility class used by Scenar components plus the --scenar-* design tokens. Wrap your scenario container with the scenar class (add dark for dark mode):

import "@scenar/react/styles.css";
import { ScenarioPlayer, SCENAR_CLASS } from "@scenar/react";

function Demo() {
  return (
    <div className={`${SCENAR_CLASS} dark`}>
      <ScenarioPlayer steps={steps}>{(data) => <View data={data} />}</ScenarioPlayer>
    </div>
  );
}

Option B: Tailwind host (bring your own theme)

Import theme.css for the --scenar-* token definitions only. Add a @source directive so your Tailwind build scans the package for utility classes:

/* globals.css */
@import "tailwindcss";
@import "@scenar/react/theme.css";

@source "../node_modules/@scenar/react/**/*.js";

Your host's Tailwind theme tokens (--color-foreground, --color-border, etc.) will drive player control appearance, keeping it consistent with your site.

Design tokens

All tokens are scoped under the .scenar class via @layer scenar:

| Token | Purpose | |-------|---------| | --scenar-surface | Shell content area background | | --scenar-border | Shell border color | | --scenar-foreground | Primary text / icon color | | --scenar-muted-foreground | Secondary text color | | --scenar-card | Popover / dropdown background | | --scenar-accent | Hover state background | | --scenar-primary | Active / selected indicator | | --scenar-ring | Focus ring color |

Override any token in your own CSS to customize the palette.

Components

<ScenarioPlayer>

Video-style playback engine. Renders a poster overlay, progress bar with chapter markers, transport controls, and narration audio.

import { ScenarioPlayer } from "@scenar/react";

<ScenarioPlayer steps={steps} narrationManifest={manifest}>
  {(data, stepIndex) => <YourContent data={data} />}
</ScenarioPlayer>

<DemoViewport>

Fixed virtual viewport that CSS-zooms children from a canonical width to fit the container. Decoupled from any site-specific tokens — pass your own canonicalWidth, minZoom, shellHeight, and wrapperClassName.

<Cursor>

Animated pointer overlay that spring-animates to data-cursor-target elements with a click ripple.

<ViewportTransformLayer>

Framer Motion container for smooth zoom/pan transitions.

Hooks

useStepInteractions(options)

Schedule timed mid-step interactions (scroll, cursor, click, type, hover, drag, viewport_transition). Reads interactions from each step's inline interactions field. Automatically uses setTimeout in browser mode or frame-driven firing in video-export mode.

useNarrationManifest(scenarioId, resolveUrl?)

Fetch a narration manifest JSON. The URL convention is configurable via the second argument.

useNarrationPlayback(options)

Manage audio playback synced to step progression, including mute toggle and playback rate.

useTimeSource() / <TimeSourceProvider>

Frame-based time source for deterministic video rendering (e.g. Remotion).

useVideoExport() / <VideoExportProvider>

Video export settings context (hides controls, sets unmuted timing).

Re-exports from @scenar/core

For convenience, @scenar/react re-exports all types and constants from @scenar/core, so consumers can import everything from a single package.

License

Apache-2.0