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

@mdxui/cockpit

v7.0.5

Published

App template components for mdxui - developer dashboards, auth flows, and SaaS patterns

Readme

@mdxui/cockpit

App template components for mdxui - developer dashboards, auth flows, and SaaS patterns.

Installation

npm install @mdxui/cockpit @mdxui/primitives @mdxui/themes mdxui
# or
pnpm add @mdxui/cockpit @mdxui/primitives @mdxui/themes mdxui

Quick Start

import { DeveloperDashboard } from '@mdxui/cockpit'

export default function Dashboard() {
  return (
    <DeveloperDashboard
      branding={{ name: 'My App', logo: <Logo /> }}
      theme="default"
    />
  )
}

Composability

DeveloperDashboard is fully composable - you can add custom routes, hide built-in routes, and customize branding.

Adding Custom Routes

<DeveloperDashboard
  customRoutes={[
    {
      path: '/analytics',
      label: 'Analytics',
      icon: 'BarChart3',  // Lucide icon name
      element: <AnalyticsPage />,
      group: 'main',
    },
    {
      path: '/integrations',
      label: 'Integrations',
      icon: 'Plug',
      element: <IntegrationsPage />,
      group: 'settings',
    },
  ]}
/>

Hiding Built-in Routes

<DeveloperDashboard
  routes={{
    overview: true,
    apiKeys: true,
    webhooks: true,
    usage: false,      // Hide usage page
    billing: false,    // Hide billing page
    team: true,
    settings: true,
  }}
/>

Full Configuration

<DeveloperDashboard
  // Branding
  branding={{
    name: 'Acme API',
    logo: <AcmeLogo />,
  }}

  // Theme
  theme="stripe"

  // Route visibility
  routes={{
    overview: true,
    apiKeys: true,
    webhooks: true,
    usage: true,
    billing: true,
    team: true,
    settings: true,
  }}

  // Custom pages
  customRoutes={[
    { path: '/logs', label: 'Logs', icon: 'ScrollText', element: <LogsPage /> },
  ]}

  // Auth integration (WorkOS)
  identity={{
    provider: 'workos',
    clientId: process.env.WORKOS_CLIENT_ID,
  }}
/>

Standalone Components

Use standalone components to embed individual pages in your own app shell without the full dashboard.

import {
  StandaloneProvider,
  StandaloneAPIKeys,
  StandaloneWebhooks,
  StandaloneBilling,
  StandaloneTeam,
} from '@mdxui/cockpit'

function MySettings() {
  return (
    <StandaloneProvider config={{ theme: { preset: 'stripe' } }}>
      <Tabs>
        <TabsContent value="keys">
          <StandaloneAPIKeys />
        </TabsContent>
        <TabsContent value="webhooks">
          <StandaloneWebhooks />
        </TabsContent>
      </Tabs>
    </StandaloneProvider>
  )
}

With Backend Integration

Standalone components accept data and callbacks for real backend integration:

import { StandaloneAPIKeys, type ApiKey } from '@mdxui/cockpit'

function APIKeysSettings() {
  const [keys, setKeys] = useState<ApiKey[]>([])

  return (
    <StandaloneAPIKeys
      keys={keys}
      onCreateKey={async (name) => {
        const result = await api.createKey(name)
        setKeys([...keys, result])
        return { id: result.id, key: result.key }
      }}
      onRevokeKey={async (id) => {
        await api.revokeKey(id)
        setKeys(keys.filter(k => k.id !== id))
      }}
      onRenameKey={async (id, name) => {
        await api.renameKey(id, name)
        setKeys(keys.map(k => k.id === id ? { ...k, name } : k))
      }}
    />
  )
}

Available Standalone Components

| Component | Data Prop | Callbacks | |-----------|-----------|-----------| | StandaloneAPIKeys | keys: ApiKey[] | onCreateKey, onRevokeKey, onRenameKey | | StandaloneWebhooks | endpoints: WebhookEndpoint[] | onCreateEndpoint, onUpdateEndpoint, onDeleteEndpoint | | StandaloneBilling | billingData: BillingData | onManagePlan, onUpdatePaymentMethod, onDownloadInvoice, onToggleAlerts | | StandaloneTeam | — | useMockWidgets (uses WorkOS widgets) |

All standalone components support hideHeader (default: true) and className props.

Auth Pages

import { LoginPage, SignupPage, OTPPage } from '@mdxui/cockpit/auth'

// Login page with all options
<LoginPage
  logo={<Logo />}
  title="Welcome back"
  onSubmit={handleLogin}
  providers={['google', 'github']}
/>

// Signup with onboarding
<SignupPage
  logo={<Logo />}
  onSubmit={handleSignup}
/>

// OTP verification
<OTPPage
  logo={<Logo />}
  email="[email protected]"
  onVerify={handleVerify}
/>

Components

Main Dashboard

  • App / DeveloperDashboard - Full dashboard wrapper with routing
  • DashboardLayout - Layout with sidebar navigation
  • DashboardGrid - Responsive grid for dashboard widgets

Auth Components

  • AuthLayout - Shared auth page layout
  • LoginPage - Login with social providers
  • SignupPage - Registration flow
  • PasswordResetPage - Password recovery
  • OTPPage - One-time password verification
  • OnboardingPage - User onboarding wizard

Dashboard Widgets

  • KPICard - Key performance indicator cards
  • AreaChart - Area chart visualization
  • BarChart - Bar chart visualization
  • LineChart - Line chart visualization
  • DataTable - Sortable, filterable data table
  • ActivityFeed - Recent activity timeline

App Features

  • APIKeyManager - API key creation and management
  • TeamManager - Team member management
  • Billing - Subscription and billing UI
  • UserProfile - User profile settings
  • SettingsPage - App settings

Navigation

  • NavMain - Main navigation menu
  • NavUser - User menu dropdown
  • TeamSwitcher - Workspace/team switcher
  • CommandPalette - Keyboard-driven command palette

Theme System

import { useThemeStore, ThemeScript } from '@mdxui/cockpit/themes'

// In your root layout
<ThemeScript />

// Toggle theme
const { theme, setTheme } = useThemeStore()

Exports

// Main export
import { DeveloperDashboard } from '@mdxui/cockpit'

// Standalone components (embed in your own shell)
import {
  StandaloneProvider,
  StandaloneAPIKeys,
  StandaloneWebhooks,
  StandaloneBilling,
  StandaloneTeam,
  type ApiKey,
  type WebhookEndpoint,
  type BillingData,
} from '@mdxui/cockpit'

// Developer components
import { KPICard, DataTable } from '@mdxui/cockpit/developer'

// Auth pages
import { LoginPage, SignupPage } from '@mdxui/cockpit/auth'

// Theme utilities
import { useThemeStore, ThemeScript } from '@mdxui/cockpit/themes'

Peer Dependencies

  • react ^18.0.0 || ^19.0.0
  • @mdxui/primitives - Base UI components
  • @mdxui/themes - Theme system
  • mdxui - Core types and contracts

Links

Architecture

@mdxui/cockpit sits at the template layer - implementing the AppComponents interface from mdxui for developer dashboards and SaaS apps.

┌─────────────────────────────────────────────────────────────────┐
│                      mdxui (interfaces)                          │
│   AppComponents interface defines: Dashboard, APIKeys, Billing   │
└─────────────────────────────────────────────────────────────────┘
                              ↓ implements
┌─────────────────────────────────────────────────────────────────┐
│                  @mdxui/primitives (raw UI)                      │
│   Button, Card, Dialog - base building blocks                    │
└─────────────────────────────────────────────────────────────────┘
                              ↓ uses
┌─────────────────────────────────────────────────────────────────┐
│            ★ @mdxui/cockpit (app templates) ← YOU ARE HERE       │
│   DeveloperDashboard, APIKeys, Webhooks, Billing, Team...        │
│   Implements AppComponents for end-user apps                     │
└─────────────────────────────────────────────────────────────────┘

Relationship to Other Packages

| Package | Relationship | |---------|--------------| | mdxui | Implements AppComponents interface | | @mdxui/primitives | Uses for base UI components | | @mdxui/themes | Uses for theming | | @mdxui/admin | Admin-focused components (operators) | | saaskit | Generates apps using cockpit components |

Key Distinction: cockpit vs admin

| Package | For | Focus | |---------|-----|-------| | @mdxui/cockpit | End users, customers | Product experience, developer tools | | @mdxui/admin | Operators, admins | CRUD, data management, internal tools |

License

MIT