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

@byteion/js

v0.1.0-beta.1

Published

Behavior-only runtime for Byteion interactive components. Driven by data-bi-* attributes.

Readme

@byteion/js

Behavior-only runtime for Byteion's interactive components. Plain vanilla JavaScript — no React, no Vue, no framework. Wires up modals, dropdowns, popovers, tabs, accordions, tooltips, drawers, and toasts in any HTML page that uses Byteion markup.

If you use @byteion/react or @byteion/vue, you do not need this package — those wrappers re-implement the behaviors as hooks / composables. Install this when you're driving the design system from server-rendered HTML (Laravel, Rails, Django, plain HTML, etc.).

Install

npm install @byteion/js @byteion/core

How it works

  1. You write markup with data-bi-* attributes (see @byteion/core/src/components/<name>/index.html for canonical examples).
  2. Import this package once.
  3. On DOMContentLoaded, every interactive widget is auto-initialized.
  4. A MutationObserver watches the DOM and re-initializes anything inserted later (HTMX, Turbo, Alpine, jQuery — all welcome).
<!-- in your HTML -->
<button data-bi-modal-toggle="#my-modal">Open</button>
<div id="my-modal" data-bi-modal>
  <div data-bi-modal-content>
    <h2>Hello</h2>
    <button data-bi-modal-hide>Close</button>
  </div>
</div>

<script type="module">
  import '@byteion/js';
  // That's it. Byteion auto-initializes on load.
</script>

Usage

Auto-init (default)

import '@byteion/js';

Side effect: registers window.ByteionCore and runs init(document) once the DOM is ready. The mutation observer keeps watching document.body for dynamically inserted widgets.

Explicit control

import ByteionCore from '@byteion/js';

ByteionCore.init();                 // re-scan the whole document
ByteionCore.init(myContainer);      // scan a subtree only
ByteionCore.destroy();              // tear everything down
ByteionCore.observerEnabled = false; // stop watching for new nodes

Per-module imports (smaller bundles)

import Modal    from '@byteion/js/modal';
import Dropdown from '@byteion/js/dropdown';
import Popover  from '@byteion/js/popover';
import Tabs     from '@byteion/js/tabs';
import Accordion from '@byteion/js/accordion';
import Tooltip  from '@byteion/js/tooltip';
import Drawer   from '@byteion/js/drawer';
import Toast    from '@byteion/js/toast';

Modal.init(document);
Modal.show('#my-modal');
Modal.hide('#my-modal');

Low-level utilities

import { trapFocus }          from '@byteion/js/focus-trap';
import { onClickOutside }     from '@byteion/js/click-outside';
import { handleArrowKeys }    from '@byteion/js/keyboard-navigation';
import { setAttributes }      from '@byteion/js/aria-helpers';
import { findFocusableInside } from '@byteion/js/dom-helpers';

Universal dismiss contract

Any element with data-bi-dismiss="<css-selector>" removes the closest matching ancestor on click. Used to wire up "close" buttons in alerts and toasts without inline onclick handlers:

<div class="alert">
  Heads up!
  <button data-bi-dismiss=".alert" aria-label="Dismiss">×</button>
</div>

SSR safety

Every module is safe to import in a Node / SSR environment. Each init() is gated by a typeof document === 'undefined' check and no-ops outside the browser. You can import this package in Next.js, Remix, Nuxt, SvelteKit, etc., without window is not defined errors.

Peer dependency

This package expects markup that matches @byteion/core's reference HTML. Versions are kept in lockstep — install matching majors:

{
  "peerDependencies": {
    "@byteion/core": "^0.1.0"
  }
}

License

MIT © Byteion