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

@alwith/module-tabs

v0.6.1

Published

A shared tab system for pages, tools and documents. The core has no React, DOM, filesystem or native-host dependency. React rendering uses the published shadcn Vega primitives.

Readme

@alwith/module-tabs

A shared tab system for pages, tools and documents. The core has no React, DOM, filesystem or native-host dependency. React rendering uses the published shadcn Vega primitives.

Entry points

  • @alwith/module-tabs/core: createTabController, createTabState and presentation contracts.
  • @alwith/module-tabs/react: TabStrip and TabActionButton.
  • @alwith/module-tabs/styles.css: complete scoped styles. No editor stylesheet is required.

Applications provide the usual semantic theme tokens (--background, --foreground, --muted, --muted-foreground, --accent, --border, --ring, --sidebar-foreground, --radius-md). --chrome-hover-background can override the toolbar hover overlay. Include the package's dist files in Tailwind's source scanning when consuming the shared Vega primitives.

Plain pages

import { createTabController } from "@alwith/module-tabs/core"
import { TabStrip } from "@alwith/module-tabs/react"
import "@alwith/module-tabs/styles.css"

const controller = createTabController({
  initial: {
    tabs: [{ id: "home", title: "Home", transient: false, dirty: false, closable: false }],
    activeId: "home",
  },
  beforeClose: async (tab) => await confirmPageClose(tab.id),
})

<TabStrip
  controller={controller}
  prefix="pages"
  labels={labels}
  newTabAction={{ label: "New page", onInvoke: createPage }}
  renderIcon={renderPageIcon}
  renderContextMenu={renderPageMenu}
  trailing={<PageActions />}
  onError={reportError}
/>

Dispose an owned controller when its host is destroyed. Keep the controller stable across renders. prefix must be unique per mounted strip; the host connects panels using ${prefix}-panel-${id} and ${prefix}-tab-${id}. The labels contract includes the strip label (newTab) and the common close commands. A host may supply a preformatted shortcutLabel for the new-tab tooltip; shortcut registration remains host-owned.

beforeClose resolves false to cancel. Duplicate concurrent closes share one promise. A cancelled close stops a batch. Closing a tab returns to its opener if still present, otherwise its neighbor, and does not steal a later selection. createTabState provides the same ordered selection and close coordinator to document adapters without copying document state.

Interaction and layout

Tabs range from 90 to 240 CSS pixels, separated by 4 pixels. Only tabs scroll. A new-tab action follows the tabs and docks before trailing actions when needed; its separator uses a 16-pixel gap. Titles fade before visible close controls and never use ellipses. Pointer reordering includes edge scrolling, RTL and cancellation. Keyboard navigation, middle-click close, preview retention, reduced motion and continuous-close geometry are built in.

The strip renders where mounted and does not own application panels, filesystem operations, persistence, global shortcuts or window controls. File integration is provided separately by @alwith/module-editor/tabs.

Validation

Run bun run build and bun run test. Unit tests include a non-file page consumer. Browser geometry and integration checks run in the consuming application against locally packed packages before release.