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

@algoplot/react

v0.4.0

Published

React components for @algoplot/core: the AlgoPlayer, transport controls, and 17 structure views.

Readme

@algoplot/react

The React half of algoplot: AlgoPlayer — the recording, the visualisation area, transport, memory chart and log panel — plus the individual components if you want to build your own surface.

npm install @algoplot/react @algoplot/core
# react and react-dom are peer dependencies (18 or 19)
npm install react react-dom
import { AlgoPlayer } from '@algoplot/react';
import '@algoplot/react/styles.css';

export function Demo({ data }: { data: RunOutput }) {
  return <AlgoPlayer data={data} />;
}

RunOutput comes from @algoplot/core (executeRun, WorkerRunner, or a fence executed at build time by @algoplot/remark).

Props

| Prop | Default | Meaning | | --- | --- | --- | | data: RunOutput | — | The recording. A new identity reloads the player. | | autoplay | off | Start playback when a recording loads. | | logs | auto | Show the log panel; defaults to “the run logged something” (decided once from the recording, so it can’t flicker while scrubbing). | | memory | on | Show the memory-growth chart above the transport. | | placeholder | auto | Caption while sitting on step 0 with no message. | | className | — | Extra class on the root (which is always ak-player). | | store | owned | Bring your own createPlayerStore(…) so controls outside the widget can drive it. The component never stops a store it does not own. |

Styling

@algoplot/react/styles.css is the complete sheet, scoped under .ak-player and declaring its palette on that class from the CSS custom properties (--panel, --border, --accent, --dim, …). To theme it, override those properties on the root (or any ancestor — custom properties inherit):

.my-page .ak-player { --accent: #7c5cff; }

The sheet also contains the phone layout (max-width: 900px), so it behaves the same wherever it is mounted.

Server rendering

import { renderToString } from 'react-dom/server';
import { AlgoPlayer } from '@algoplot/react';

renderToString(<AlgoPlayer data={run} />);

The store is created with the recording (createPlayerStore(run)), so SSR emits the real first frame — not a placeholder that swaps after hydration. Note that zustand’s server snapshot is the store’s initial state: anything you change after creation is visible client-side only, which is why the player also loads data in an effect (a no-op when the initial state already matches).

Composing your own UI

import { PlayerProvider, usePlayer, Transport, MemoryGraph, LogPanel } from '@algoplot/react';

function JumpTo({ step }: { step: number }) {
  const seek = usePlayer((s) => s.seek);   // or getState() for imperative access
  return <button onClick={() => seek(step)}>Jump</button>;
}

<PlayerProvider store={myStore}>
  <Transport />
  <MemoryGraph />
  <LogPanel />
</PlayerProvider>

usePlayer(selector) subscribes; usePlayerStore() returns the raw store for getState()/setState(); StructView renders one structure from world if you want the views without the chrome.

License

MIT — Copyright (c) 2026 Gerald Lee <[email protected]>.