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

@cboxdk/cbox-ui

v0.6.0

Published

Cbox shared UI — layout primitives, design tokens, and brand assets used across every Cbox-family app (id, cortex, atlas, track, …).

Downloads

120

Readme

@cboxdk/cbox-ui

Shared UI for the Cbox app family — id, cortex, atlas, track, and whatever's next.

This package gives every Cbox app the same chrome (top bar, org switcher, app launcher, user menu, notifications bell) and the same page primitives (panels, headers, tabs, status pills) so cross-app navigation feels like one product. It also ships the design tokens (colours, fonts, radii) and the brand assets in one place.

The package is headless about data: every component reads identity, organization, and notification state from a <CboxIdProvider> context that the consuming app populates from the future @cboxdk/cbox-id-client SDK. Components never fetch — they render what the host gave them.

Install

# In a Cbox-family app
bun add @cboxdk/cbox-ui clsx tailwind-merge
# Peer deps (you almost certainly already have these):
bun add react react-dom tailwindcss lucide-react

The package is published on npm as @cboxdk/cbox-ui under the MIT License. The Cbox name and logos in assets/ are trademarks and are not covered by the licence (see TRADEMARKS.md).

Wire it up

1. Pull the design tokens into your CSS

/* resources/css/app.css */
@import 'tailwindcss';
@import '@cboxdk/cbox-ui/tokens';

That's it — every text-foreground, bg-card, border-border, text-mono, etc. utility now resolves against the Cbox palette. Light + dark variants come bundled.

2. Wrap the app root with <CboxIdProvider>

In id itself (which IS the source of truth), populate from Inertia shared props:

import { CboxIdProvider } from '@cboxdk/cbox-ui';

export default function AppRoot({ shared, children }) {
    return (
        <CboxIdProvider value={shared.cboxId}>
            {children}
        </CboxIdProvider>
    );
}

In cortex / atlas / track / future apps, populate from the id-client SDK on session start:

import { CboxIdProvider } from '@cboxdk/cbox-ui';
import { useIdSession } from '@cboxdk/cbox-id-client';

export default function AppRoot({ children }) {
    const session = useIdSession(); // {user, organizations, currentOrg, ...}
    return (
        <CboxIdProvider value={session.cboxIdContext}>
            {children}
        </CboxIdProvider>
    );
}

The context shape is exported as CboxIdContextValue — see src/context/cbox-id.tsx for the full surface. Required keys:

  • user — {id, name, email, avatar_url?, locale?, timezone?}
  • currentOrganization — current org context (or null on user-only surfaces)
  • organizations — every org the user belongs to (drives the switcher)
  • apps — sister apps for the launcher
  • urls — {idBaseUrl, accountUrl, orgSettingsUrl, switchOrgUrl, signOutUrl}
  • notifications? — {unreadCount, inboxUrl} (optional, hides the bell when missing)
  • onSwitchOrganization? — callback when the user picks an org (default: form-POST to urls.switchOrgUrl)

3. Drop in the chrome

import { TopBar } from '@cboxdk/cbox-ui';

<TopBar
    brand={<MyAppLogo />}
    centre={<MySearchBar />}
    showOrgSwitcher
/>

The default right-cluster is <AppLauncher> → <NotificationsBell> → <UserMenu>. Override with rightCluster={...} if a particular app needs a different mix.

4. Use page primitives

import {
    PageShell,
    PageHeader,
    PageTabs,
    DataPanel,
    PanelBody,
    SectionHeader,
    StatusPill,
    EmptyState,
    StatTile,
    KeyValue,
} from '@cboxdk/cbox-ui';

Match id's existing patterns — see id/resources/js/pages/* for examples.

Components

Chrome (cross-app navigation)

| Component | What it does | |---|---| | TopBar | Standard 56px-tall app bar. Slot for brand + centre + right cluster. | | OrgSwitcher | Dropdown listing the user's orgs. Calls onSwitchOrganization (or POSTs to urls.switchOrgUrl) on pick. | | AppLauncher | 9-dot grid showing sister Cbox apps the user can jump into. | | UserMenu | Avatar dropdown with "Manage account ↗" + "Team & billing ↗" (deep-links into id) + Sign out. | | NotificationsBell | Bell icon with unread badge, links to id's unified inbox. Renders nothing if context lacks notifications. |

Page primitives

| Component | What it does | |---|---| | PageShell | Outer page container with vertical rhythm. | | PageHeader | Title + description + actions slot. Tab-strip-aware (no padding mismatch when followed by PageTabs). | | PageTabs | Tabs strip on the page baseline. Pass currentPath + optional LinkComponent (Inertia's Link, Next's, etc.). | | DataPanel / PanelBody / SectionHeader | The default building block for content sections. | | StatusPill | Coloured chip for status / state. Tones: success / warning / destructive / info / muted / neutral. | | EmptyState | Centred icon + heading + description for empty lists. | | StatTile | Big-number metric tile. | | KeyValue / KeyValueList | Definition-list style "label → value" for detail panels. | | Heading | Section heading without the panel chrome. |

Versioning

This package follows semver. Breaking changes get a major bump — every Cbox app pinning a major version stays safe. New components, new optional props, new tokens → minor. Token tweaks that don't change the visual contract → patch.

In practice during the early days (v0.x): treat every release as potentially breaking, pin exact versions, upgrade in lockstep.

Local dev against id

While iterating, bun link the package locally so id picks up changes on rebuild:

# In cbox-ui:
bun run build && bun link

# In id:
bun link @cboxdk/cbox-ui
bun run dev

Switch back to the published version with bun unlink @cboxdk/cbox-ui && bun install.

Brand

Brand guidelines, logo files, and the canonical asset set live in BRAND.md and assets/.