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

@go-go-golems/pbui-react

v0.1.2

Published

PBUI react package.

Readme

@go-go-golems/pbui-react

This package binds a @go-go-golems/pbui-core engine to React. It is deliberately small, because the division of labor is strict: the engine owns every interaction semantic (what a click means, what is eligible, what the menu contains), and React owns rendering. The binding's job is to register what each component presents, route DOM gestures into the engine, and re-render exactly the components whose presentation flags changed.

What a presentation is, in React terms

Wrapping rendered content in <Presentation> registers a record in the engine's registry for the component's lifetime and attaches the full gesture protocol:

import { PbuiProvider, Presentation, usePbuiSurface } from "@go-go-golems/pbui-react";

<Presentation type="customer" object={{ kind: "customer", id: c.id }} label={c.name}>
  {c.name}
</Presentation>

From that one wrapper the customer name acquires: a hover outline and doc-line entry, a right-click menu of exactly the commands applicable to CUSTOMERs (state-sensitively), a left-click default command, middle-click describe, keyboard reachability (roving focus, Enter, m, d), and eligibility during input contexts — it will grow a marching-ants outline whenever some command is asking for a CUSTOMER, and clicking it then supplies the argument.

<SvgPresentation> is the same protocol for SVG (<g> wrapper, an optional invisible hitRect, ring-rect highlights, since SVG has no CSS outline). Both are sugar over the headless usePresentation hook, which returns the gesture props and the state flags for cases where you render the element yourself.

The shell

function App({ engine }) {
  const surface = usePbuiSurface();   // background right-click menu, hover clearing
  return (
    <div className="pbui-root" {...surface}>
      <YourPanes />
    </div>
  );
}

<PbuiProvider engine={engine}>   {/* global Escape handling lives here */}
  <App engine={engine} />
</PbuiProvider>

The render-cost model

usePresentation subscribes to its own registry record only (registry.subscribePres), not to engine state. Hover transitions therefore re-render the old target, the new target, and other presentations of the same objects — measured at 1.98 component renders per hover transition with 2,000 presentations mounted. Accept transitions broadcast, because an input context legitimately changes every presentation's flags. If you build your own consumers, follow the same split: useEngineState() for chrome that reflects any change (doc bars, status lines), subscribePres for anything that scales with presentation count.

Key exports

| Export | Role | |---|---| | PbuiProvider, useEngine | engine context + global Escape | | usePresentation | the headless primitive: registration + gesture props + flags | | Presentation, SvgPresentation | HTML and SVG sugar over the hook | | usePbuiSurface | root-element handlers (background menu, hover clear) | | useEngineState, useTranscript | subscriptions for chrome-level components |

Props that change behavior

  • quiet — container presentations: menuable and describable, but no hover flash over their contents and never dimmed inert.
  • duringAccept="active" | "fallthrough" — participation during foreign input contexts: active keeps navigation clickable (its default command must be marked duringAccept in the command table), fallthrough makes decoration gesture-transparent so clicks reach the canvas beneath. The default (gated) dims and swallows, and most presentations should keep it.
  • disabled — render-only: no registration, no gestures.

Deeper material: docs/getting-started.md for the tutorial, docs/user-guide.md for the concepts, docs/api-reference.md for exact signatures.