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

@statewalker/shell.view.react

v0.2.2

Published

Dock renderer fragment: dockview-react host, MainShell, ShellHeader, JsonPanel.

Downloads

90

Readme

@statewalker/shell.view.react

What it is

The React application shell. MainShell lays out a header, left and right side panels, overlays, and a central dockview area with tabs. DockViewHost mounts dockview-react and binds its API to the DockHost adapter from @statewalker/shell.core, so dock:* commands open, focus and close real tabs. Every tab renders through a single json panel kind, which looks up a json-render spec and catalog and renders it with SpecRenderer.

Why it exists

@statewalker/shell.core defines the dock commands (dock:show-panel, dock:close-panel, dock:focus-panel), the slots that describe the shell chrome (dock:header-items, dock:side-panels, dock:overlays) and the DockHost adapter, all without React. Something has to resolve the contributions' viewKeys to components, own the dockview instance, and draw the frame. This package does that, and registers MainShell under shell:root so @statewalker/ui.view.react renders it without importing it.

How to use

pnpm add @statewalker/shell.view.react

Peer dependencies: react and react-dom (>=18).

| Import | Provides | | --- | --- | | @statewalker/shell.view.react | MainShell, DockViewHost, dockTabIconSlot, DockTabIcon; default export is the fragment init | | @statewalker/shell.view.react/fragment | Default export: init(ctx) registering MainShell into core:views under shell:root | | @statewalker/shell.view.react/styles | Tailwind v4 @source globs |

The built JS imports dockview-react/dist/styles/dockview.css and a local CSS file, so the host bundler must handle CSS imports. Browser only.

import "@statewalker/shell.view.react/styles";
import initShellView from "@statewalker/shell.view.react/fragment";

const cleanup = initShellView(ctx); // after the shell.core logic fragment

Once the workspace is ready, <App/> from @statewalker/ui.view.react renders MainShell.

Examples

Add an icon to tabs whose panel id has a prefix

import { Slots } from "@statewalker/shared-slots";
import { dockTabIconSlot } from "@statewalker/shell.view.react";
import { FileText } from "lucide-react";

const slots = workspace.requireAdapter(Slots);
const remove = slots.provide(dockTabIconSlot, { panelIdPrefix: "file:", Icon: FileText });

The tab uses the entry with the longest panelIdPrefix that the panel id starts with, so "chat:agent:" wins over "chat:". Icon must accept a className prop.

Render the dock area alone (for example in a test)

import { DockViewHost } from "@statewalker/shell.view.react";

<DockViewHost workspace={workspace} />;

DockViewHost takes the Workspace as a prop. The panels inside read it from React context (useAppWorkspace()), so an <AppWorkspaceProvider> must still be an ancestor.

Internals

Layout

MainShell
+------------------------------------------------------------+
| ShellHeader: dock:header-items "leading" ...    "trailing" |
+-----------+-------------------------------+----------------+
| side      | DockViewHost                  | side           |
| panels    |  tabs (LineTab)               | panels         |
| "left"    |  each tab = JsonPanel         | "right"        |
+-----------+-------------------------------+----------------+
dock:overlays mounted next to the layout (dialogs etc.)

Every slot entry carries a viewKey; the component is looked up in core:views at render time. An unknown key renders nothing.

One panel kind: json

DockViewHost registers exactly { json: JsonPanel }. A tab's content comes from a SpecRecord in SpecStore (by specId) and the registry stored under its catalogId in the json:catalogs slot. New kinds of tabs are added with new specs and catalogs, not new dockview components. JsonPanel re-renders when its spec changes.

What you see when something is missing:

  • Spec <specId> is missing. with a "Close panel" button — the tab was restored from a saved layout but no spec was created for it.
  • Catalog <catalogId> is not registered. — the view fragment that owns the catalog was not activated.

JsonPanel renders SpecRenderer without handlers. Actions dispatched by a spec in a dock tab therefore log No handler registered for action: ... and do nothing; components that need to act should call commands themselves.

Closing goes through the command bus

The tab close button and the placeholders' "Close panel" call ClosePanelCommand (dock:close-panel) instead of dockview's api.close(), so the logic side can drop the panel's spec.

API binding

DockViewHost calls DockHost.setApi(api) in dockview's onReady and DockHost.detach() on unmount. dock:show-panel calls made before the shell mounts are handled by DockHost once the API arrives.

Dependencies

  • dockview-react — the dock.
  • @statewalker/shell.core — commands, chrome slots, DockHost.
  • @statewalker/render.core, @statewalker/render.view.react — SpecStore, json:catalogs, SpecRenderer.
  • @statewalker/ui.view.react — core:views, shell:root, hooks.
  • @statewalker/ui.view.shadcn — resizable panels, cn().
  • @statewalker/shared-commands, @statewalker/shared-slots, @statewalker/shared-registry, @statewalker/workspace.core — fragment wiring.
  • lucide-react — the tab close icon.

dock:tab-icons lives here, not in shell.core, because its values are React components.

License

MIT