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

@potoru/react

v0.1.1

Published

React components for Potoru stories: <PotoPlayer>, <PotoSnapshot> and <PotoEditor>, thin wrappers of the @potoru/web elements, plus compile().

Downloads

460

Readme

@potoru/react

Potoru stories in React: <PotoPlayer>, <PotoSnapshot>, <PotoEditor> and compile(). Thin wrappers of the Potoru elements (<potoru-player>, <potoru-snapshot> and <potoru-editor> from @potoru/web, a dependency), with the same names as every other Potoru host.

npm install @potoru/react react
import { useRef } from "react";
import { PotoPlayer, PotoSnapshot } from "@potoru/react";

export function Story() {
  const player = useRef(null);
  return (
    <>
      <PotoPlayer
        ref={player}
        src="https://example.com/stories/sunrise.poto"
        autoplay
        muted
        loop
        controls
        style={{ width: "100%" }}
        onReady={(detail) => console.log("ready", detail.mode, detail.duration)}
        onReport={(detail) => console.log("the story reported", detail.event, detail.payload)}
        onError={(detail) => console.warn(detail.code, detail.message)}
      />
      <button onClick={() => player.current?.restart()}>Restart</button>
      <button onClick={() => player.current?.fire("story-door", "open")}>Open the door</button>
      <PotoSnapshot src="https://example.com/stories/sunrise.poto" time={1.5} style={{ width: 240 }} />
    </>
  );
}
import { PotoEditor, compile } from "@potoru/react";

// A format v4 source folder as path → text.
const result = await compile({ yaml: files });          // { ok, poto, diagnostics, sizes }
<PotoEditor yaml={files} mode="yaml" style={{ height: 560 }} onCompiled={(r) => save(r.poto)} />

Components

| Component | Props | Ref (handle) | |---|---|---| | PotoPlayer | src (URL or bytes), libraries, mode, camera, autoplay, muted, loop, controls, captions, still + time, fit, renderer, id, className, style; onReady, onPlay, onPause, onEnded, onReport, onError, onSlide, onScene, onCaption, onCamera | play(), pause(), seek(s), restart(), next(), prev(), goto(i), set(target, data, value), fire(target, event, payload?), setCamera(id), load(src), currentTime(), duration(), element | | PotoSnapshot | src, time, libraries, camera, fit, id, className, style; onReady, onError | seek(s), load(src), currentTime(), duration(), element | | PotoEditor | yaml, mode ("yaml" or "script"), script, id, className, style; onCompiled, onError | getFiles(), setFiles(), getScript(), setScript(), setMode(), compile(), download(), lastResult, element |

compile(input): { yaml } (YAML mode, a source folder) or { script, yaml? } (Script mode, authoring-API JavaScript in a sandbox; browsers only, JavaScript only in 1.0). Never rejects for bad source: problems come back as diagnostics with file and line. The full interface, shared by every host: docs/COMPONENTS.md in the repository.

Notes

  • PotoPlayer and PotoSnapshot use @potoru/web/player; PotoEditor and compile() import the full @potoru/web lazily when the editor mounts or compile() runs, and the compiler itself loads on the first compile: an app that imports only PotoPlayer / PotoSnapshot bundles no compiler or editor code.
  • The module starts with "use client" (Next.js App Router); the elements register in the browser only. On the server the components render the bare tags.
  • With an app bundler, copy node_modules/@potoru/web/dist/fonts/ to fonts/ next to your page for stories that use the built-in fonts (see the @potoru/web README).
  • A package that needs a newer player fails with onError code needs-newer-player.
  • react 18 or 19 is a peer dependency. Versions move in lockstep with @potoru/web.

Licence

Apache-2.0 (LICENSE, NOTICE). "Potoru" is a trademark of The Potoru Authors.