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

@metabindai/bindjs-react

v1.0.9

Published

React renderer for BindJS

Downloads

206

Readme

@metabindai/bindjs-react

The official React renderer for BindJS, the cross-platform declarative UI framework at the heart of Metabind, the hosted platform for MCP Apps. It draws resolved BindJS components as React DOM — use it to render BindJS content inside your own React app, and it's the same renderer that draws Interactive Tools in the sandboxed iframes MCP hosts use.

This package sits on top of @metabindai/bindjs-runtime, which evaluates component definitions — state, modifiers, and component trees — independent of any UI framework. The runtime resolves what to draw; this package draws it.

Install

npm install @metabindai/bindjs-react react react-dom styled-components

react (^18.3.1), react-dom (^18.3.1), and styled-components (^6.1.14) are peer dependencies — your app provides them, which avoids duplicate-React "invalid hook call" errors. @metabindai/bindjs-runtime is a regular dependency and installs automatically.

Usage

Create a BindJSRuntime, register a component's JavaScript source, and pass both to <Renderer>:

import { useMemo } from 'react'
import { BindJSRuntime } from '@metabindai/bindjs-runtime'
import { Renderer } from '@metabindai/bindjs-react'

// A BindJS component definition, compiled to plain JavaScript
// (`export default` becomes `exports.default` after transpilation).
const source = `exports.default = defineComponent({
    body: () => VStack({ spacing: 8 }, [
        Text("Hello from BindJS").font("largeTitle"),
    ]),
})`

export function App() {
    const runtime = useMemo(() => {
        const rt = new BindJSRuntime()
        rt.registerComponent('Hello', source)
        return rt
    }, [])

    return <Renderer runtime={runtime} componentName="Hello" />
}

<Renderer> also accepts an environment prop for values like the color scheme, for example environment={{ colorScheme: 'dark' }}.

Other notable exports:

  • useBindJSRuntime() — a hook that creates and memoizes a BindJSRuntime for the lifetime of a component.
  • AssetsProvider, ContentProvider, and FontManager — context providers that supply assets, content lookup, and fonts to rendered components.

For a working end-to-end setup, see the playground example in this repository — a live editor and preview built on this package.

Type definitions

The published package includes a types/ directory (types/metabind.d.ts and friends) declaring the BindJS authoring API — components, modifiers, and data types. The playground loads these into Monaco for IntelliSense, using Vite's ?raw import to read them as strings; you can do the same in any in-browser editor:

import METABIND_TYPES from '@metabindai/bindjs-react/types/metabind.d.ts?raw'

Developing

This package lives in the bindjs-runtime monorepo. Build and test from the repository root:

pnpm install
pnpm build
pnpm test

See the repository README for the playground workflow, local linking from a consumer repo, and publishing.

License

Apache License 2.0. See LICENSE.