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

bonsai-kit

v0.0.12

Published

A standard Web Components UI kit for userscript authors — Shadow-DOM-isolated, zero-dependency primitives (floating panels, FABs, dock bars, settings, toasts, dialogs) that work safely inside any host page. Tampermonkey / Violentmonkey / Greasemonkey read

Downloads

1,728

Readme

🌳 bonsai-kit

Cultivate small, beautiful UI inside someone else's webpage.

A standard Web Components UI kit for userscript authors — Shadow-DOM-isolated, zero-dependency primitives (floating panels, FABs, dock bars, settings, toasts, dialogs) that work safely inside any host page.

npm license

Why bonsai-kit?

Userscript authors face a unique constraint: their UI lives inside someone else's page. Like a bonsai tree thriving in a borrowed garden, your scripts deserve UI that's:

  • Style-isolated — Shadow DOM means host page CSS can't break your widgets
  • Drop-in — Each component is a single <bk-*> tag; no framework runtime needed
  • @require-friendly — One-line UMD bundle for Tampermonkey / Violentmonkey / Greasemonkey
  • Persistence opt-in — Add storage-key="x" and the component remembers its state
  • GM-awareGMStore adapter for GM_setValue / GM_getValue if you need it
  • Composable — Tabs holding settings holding tags holding toasts; mix and match freely
  • Tree-shake friendly — Cherry-pick subpath imports; nothing you don't use ships

Components

| Tag | Purpose | |---|---| | <bk-resizable-panel> | Floating, collapsible, resizable container | | <bk-module-list> | Field-driven module list | | <bk-vmok-inspector> | Composite — VMOK polling + list + panel | | <bk-floating-button> | Draggable FAB | | <bk-dock-bar> | Multi-button floating toolbar | | <bk-setting-panel> | Schema-driven settings form | | <bk-tabs-view> | Lightweight tab container | | <bk-toast-stack> + toast() | Notification stack | | <bk-confirm-dialog> + confirm() | Modal confirmation |

Plus utilities: VmokSource, LocalStore, GMStore, makeDraggable, and the base class BonsaiElement for authoring new components.

See docs/components.md for full API references.

Install

npm

npm install bonsai-kit
import 'bonsai-kit'; // auto-registers all <bk-*> elements

Or cherry-pick subpaths:

import 'bonsai-kit/components/floating-button';
import { toast } from 'bonsai-kit/components/toast-stack';

Userscript / @require

// @require https://cdn.jsdelivr.net/npm/bonsai-kit@latest/dist/bonsai-kit.umd.min.js

After @require, every component is registered, and helpers are exposed on window.BonsaiKit.

Quick start

<bk-floating-button icon="🌳" storage-key="my-fab"></bk-floating-button>
<bk-resizable-panel id="p" title="Hello" storage-key="my-panel" collapsed>
  <bk-setting-panel id="s" storage-key="my-settings"></bk-setting-panel>
</bk-resizable-panel>

<script type="module">
  import 'bonsai-kit';
  const p = document.getElementById('p');
  document.querySelector('bk-floating-button')
    .addEventListener('fab-click', () => p.toggleAttribute('collapsed'));

  document.getElementById('s').schema = [
    { key: 'enabled',  label: 'Enabled', type: 'switch', default: true },
    { key: 'env',      label: 'Env',     type: 'select',
      options: [{ label: 'PPE', value: 'ppe' }, { label: 'PROD', value: 'prod' }] },
  ];
</script>

Project layout

bonsai-kit/
├── src/
│   ├── components/        # one file per <bk-*> element
│   ├── sources/           # data adapters (VmokSource, …)
│   ├── utils/             # LocalStore, GMStore, makeDraggable, escape
│   ├── internal/          # BonsaiElement base class, design tokens
│   └── index.js           # public entry & auto-registration
├── templates/component/   # scaffold template for `npm run new:component`
├── examples/              # browser demos & userscript template
├── scripts/               # build, dev server, generator
├── test/                  # node:test smoke tests
├── docs/                  # docs site source
└── dist/                  # build output (gitignored)

Adding a new component

npm run new:component json-viewer

This will:

  1. Create src/components/json-viewer.js from the template
  2. Create test/json-viewer.test.js
  3. Auto-insert export & side-effect import into src/index.js

Then implement, test, and add a changeset:

npm test
npx changeset

See CONTRIBUTING.md for full conventions.

License

MIT © bonsai-kit contributors