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

@0disoft/banora-react

v0.1.2

Published

Optional React 19 adapter for the Banora 0.1 SDK. Install with `npm install @0disoft/banora @0disoft/banora-react`. Build locally with `bun run build:adapters` from the repository root.

Readme

Banora React

Optional React 19 adapter for the Banora 0.1 SDK. Install with npm install @0disoft/banora @0disoft/banora-react. Build locally with bun run build:adapters from the repository root.

ControlledBoard accepts a required plain state snapshot and optional onIntent instead of a record controller. The host owns rules/records and supplies accepted updates; placement never changes the snapshot locally. It supports common display/ input options and borrowed onView bindings. See the host-controlled guide.

import {createElement} from 'react';
import {RecordController} from '@0disoft/banora';
import {Board, Viewer, useRecordState} from '@0disoft/banora-react';

// Create once outside render, or retain with a hook. The host owns this controller.
const controller = new RecordController({sgf: '(;SZ[9];B[aa])'});
function Review() {
  const state = useRecordState(controller);
  return createElement('section', null,
    createElement('p', null, `Move ${state.position.moveNumber}`),
    createElement(Board, {controller, readOnly: true}),
    createElement(Viewer, {controller}));
}

Board accepts SDK board options, className, React style, ariaLabel and onStateChange(state). Viewer accepts the SDK viewer options except initial sgf, plus the same container/event props. Initialize a shared controller with SGF. useRecordState(controller) returns an immutable snapshot using React's external store interface. Unmounting releases the view and subscription, preserving a host-supplied controller. Without a controller, each component owns a separate record and disposes it on unmount. Configuration changes preserve its state; controller replacement disposes/remounts the view. Host controllers must outlive their views and be disposed by the host when no longer needed.

onView(viewOrNull) supplies a borrowed BoardView/ViewerView handle for exportSvg(options) or asynchronous exportPng(options). Cleanup clears the binding with null. Use a stable callback (for example a state setter or useCallback); callback replacement clears the old binding and connects the new one. Configure through props and leave view disposal to the component. Image export does not save the SGF record or clear dirty state.

drawing={{color:'#206650',width:0.08}} enables the common freehand tool on Board; use board={{drawing:{...}}} on Viewer. Null disables drawing. Shared controller state includes immutable strokes; add/remove/clear and Undo/export/reopen use the same controller. Read-only views display saved ink, and diagrams include it. SGF uses Banora's private BPN extension, which other viewers may not display.

touch={{mode:'confirm',magnifier:true}} enables magnified touch aiming and explicit confirmation; release mode places on lift. Pass nested board.touch to Viewer. Null restores direct activation. Pending targets are view-only, keyboard-refinable, and cancelled by configuration/context changes or unmount; they never enter SGF or diagrams. Ink takes priority, and read-only views do not enter touch aiming.

Compose two Board components with nodeId, compareTo and referenceGeneration from the controller snapshot's recordGeneration for side-by-side comparisons. Pinned boards display their own node/path and differences without navigating or editing the shared controller. Missing/stale pins become unavailable; their images cannot be exported until restored/rebound. Viewer follows its cursor and accepts board.compareTo for a reference overlay. The React example demonstrates pinning, configuration updates, controller ownership and remounts.

The framework owns the empty container; the SDK owns its descendants. SSR emits only containers; board DOM mounts in client effects. Supply matching record content on server/client for state hydration. Rendered board HTML hydration is deferred. See the repository's SDK public API, compatibility document and React consumer example for the currently tested versions and limitations.