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

@trops/dash-core

v0.1.24

Published

Core framework for Dash dashboard applications

Readme

@trops/dash-core

Core framework for Dash dashboard applications. Provides the widget system, provider architecture, context providers, layout engine, and Electron main process layer used by all Dash apps.

Installation

npm install @trops/dash-core

Peer dependencies:

{
    "@trops/dash-react": ">=0.1.187",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
}

Two Export Paths

Renderer (React)

Platform-agnostic UI framework — contexts, hooks, models, components, widget system.

import {
    ComponentManager,
    DashboardPublisher,
    ErrorBoundary,
    // Contexts
    AppContext,
    DashboardContext,
    ThemeWrapper,
    ProviderContext,
    // Hooks
    useDashboard,
    useMcpProvider,
    useWidgetProviders,
    useInstalledWidgets,
    // Models
    DashboardModel,
    LayoutModel,
    ThemeModel,
    // Components
    LayoutBuilder,
    SettingsPanel,
    NavigationBar,
    // Widget
    Widget,
    WidgetFactory,
    ExternalWidget,
} from "@trops/dash-core";

Electron (Main Process)

Controllers, IPC handlers, events, and widget pipeline for Electron apps.

const {
    // Factory
    createMainApi,
    // Controllers
    providerController,
    mcpController,
    workspaceController,
    themeController,
    registryController,
    // Widget pipeline
    widgetRegistry,
    widgetCompiler,
    dynamicWidgetLoader,
    // Events
    events,
} = require("@trops/dash-core/electron");

Architecture

@trops/dash-core
├── src/                    Renderer layer (ESM + CJS)
│   ├── Api/                IPC API clients
│   ├── Components/         Dashboard, Layout, Settings, Navigation, etc.
│   ├── Context/            React Context providers
│   ├── Models/             Data models (Dashboard, Layout, Theme, etc.)
│   ├── Widget/             Widget, WidgetFactory, ExternalWidget
│   ├── hooks/              useDashboard, useMcpProvider, useWidgetProviders
│   └── utils/              Bundle loader, layout helpers, validation
│
└── electron/               Electron layer (CJS only)
    ├── api/                IPC handlers + createMainApi factory
    ├── controller/         Business logic (providers, MCP, themes, etc.)
    ├── events/             Event definitions
    ├── mcp/                MCP server catalog
    └── utils/              File, color, browser utilities

Key Patterns

createMainApi Factory

Template apps use createMainApi(extensions) to combine core APIs with custom ones:

const { createMainApi } = require("@trops/dash-core/electron");

const api = createMainApi({
    myCustomApi: require("./myCustomApi"),
});

Provider System

Providers are read from AppContext.providers, not DashboardContext.providers. This is due to component tree ordering — DashboardWrapper renders before providers are loaded.

ThemeContext Import Rule

Always import ThemeContext from @trops/dash-react to avoid dual context instances:

// CORRECT
import { ThemeContext } from "@trops/dash-react";

// WRONG — creates separate context
import { ThemeContext } from "./Context/ThemeContext";

Documentation

See docs/INDEX.md for the full documentation index:

Related Packages

| Package | Purpose | Location | |---|---|---| | @trops/dash-react | UI component library | dash-react | | dash-electron | Electron app template | dash-electron |

Development

# Build both layers
npm run build

# Build renderer only
npm run build:renderer

# Build electron only
npm run build:electron

# Format code
npm run prettify

Publishing is automated via GitHub Actions on push to master.

License

MIT