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

@browser-ui/react

v0.2.0

Published

Composable browser UI for agent-browser pair-browsing and recordings.

Readme

@browser-ui/react

A composable browser surface for React. It supports live agent-browser pair-browsing sessions and native WebM recordings, while keeping workflow ownership in the host application.

Install

npm install @browser-ui/react

Usage

import { Browser } from "@browser-ui/react";
import "@browser-ui/react/styles.css"; // Optional reference theme.

<Browser
  streamUrl={session.streamUrl}
  viewportSize={{ width: 1440, height: 900 }}
  operating={session.agentActive}
  operatingLabel={session.currentTask}
  onTakeControl={session.takeControl}
  showPictureInPicture
  showFullscreen
/>

Components are unstyled by default and expose stable bui- classes and data attributes. Import the optional stylesheet above as a reference theme, or style the primitives with the host application's design system.

The host owns the browser process, stream URL, navigation, and workflow state. Browser owns the interactive viewport, visual agent activity, and display modes for inline, picture-in-picture, and fullscreen use.

Pointer, keyboard, paste, and wheel input are forwarded by the live viewport. Wheel capture works inside nested application scrollers and fullscreen layouts, including WebKit's legacy trackpad events, so hosts should not create a second WebSocket or install their own browser-input boundary.

Pass fullscreenTarget when fullscreen should fill an application panel rather than the complete viewport. Browser UI tracks the element's bounds, radius, and resizing while the same mounted browser frame moves above application chrome:

const [panel, setPanel] = useState<HTMLDivElement | null>(null);

<div ref={setPanel}>
  <Browser
    streamUrl={session.streamUrl}
    fullscreenTarget={panel}
    showFullscreen
  />
</div>

Host controls

Browser UI owns the control rail's placement, display-mode transitions, and visual treatment. Applications can compose their own actions into that rail without moving workflow behavior into the package:

import {
  Browser,
  BrowserDisplayTrigger,
  BrowserFullscreenTrigger,
} from "@browser-ui/react";

<Browser
  streamUrl={session.streamUrl}
  displayControls={
    <>
      <BrowserDisplayTrigger
        aria-label="Open in primary browser"
        onClick={session.openExternally}
      >
        <ExternalLinkIcon />
      </BrowserDisplayTrigger>
      <BrowserFullscreenTrigger />
      <BrowserDisplayTrigger
        aria-label="End browser session"
        onClick={session.end}
      >
        <CloseIcon />
      </BrowserDisplayTrigger>
    </>
  }
/>

Use displayControlsClassName to adjust how a host's controls reveal while keeping them inside Browser UI's package-owned top-right rail.

Access and control

Browser UI projects access state without choosing an authentication system. Map a Nostr public key, cookie session, Better Auth user, or JWT subject to a BrowserPrincipal; let the gateway enforce capabilities and an exclusive control lease.

<BrowserAccessRoot
  access={session.access}
  onRequestControl={session.requestControl}
  onReleaseControl={session.releaseControl}
>
  <Browser
    access={session.access}
    streamUrl={session.stream.url}
    protocols={session.stream.protocols}
  />
  <BrowserControlStatus />
  <BrowserControlTrigger />
</BrowserAccessRoot>

Browser sends input only when the projected viewer owns control. This is a client-side guard, not authorization: the gateway must reject every input that does not carry or belong to the current server-issued lease.

Playback

agent-browser records browser sessions to WebM with its native recording commands:

agent-browser record start ./workflow.webm
# Run the workflow.
agent-browser record stop

Render that static artifact with BrowserRecording. It uses the same frame, agent activity treatment, picture-in-picture, and fullscreen presentation as a live session. A recording is intentionally not a substitute for Browser: it does not claim to accept user input after playback has stopped.

import { useRef } from "react";
import { BrowserRecording } from "@browser-ui/react";

const recording = useRef<HTMLVideoElement>(null);

<BrowserRecording
  ref={recording}
  src="/workflows/checkout.webm"
  viewportSize={{ width: 1440, height: 900 }}
  playbackRate={1.25}
  showPictureInPicture
  showFullscreen
  videoProps={{ controls: true }}
/>

The forwarded HTMLVideoElement ref provides normal play, pause, seek, and currentTime control. Use videoProps for standard video events, captions, or controls.

See the repository for the live demo and lower-level composition primitives.