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

@hopgoldy/cube-ui

v0.1.1

Published

Shared responsive application shell and UI primitives for Cube applications

Downloads

228

Readme

@hopgoldy/cube-ui

Shared responsive application shell and UI primitives for Cube applications.

Install

pnpm add @hopgoldy/cube-ui

Import styles once in your app entry:

import "@hopgoldy/cube-ui/styles.css";

Example

// the app's top-level layout (in place of a hand-rolled AppContainer + theme provider)
import { CubeApp } from "@hopgoldy/cube-ui";
import { Outlet } from "react-router-dom";

export const AppContainer = () => (
  <CubeApp
    sidebarTop={<Logo />}
    sidebarList={<nav>Sidebar links</nav>}
    headerLeft="Cube App"
    headerSearchBtnLabel="搜索"
    onHeaderSearchBtnClick={() => openSearch()}
    accountMenuStats={[{ key: "pages", title: "页面", value: 3 }]}
    accountMenuItems={[{ key: "settings", label: "设置", onClick: () => navigate("/settings") }]}
    onLogoutBtnClick={() => logout()}
    userName={currentUser.name}
    about={{ name: "Cube App", version: "1.0.0", repository: "https://github.com/you/app" }}
  >
    <Outlet />
  </CubeApp>
);
// any page that needs a mobile settings entry point
import { MobileAccountSheet } from "@hopgoldy/cube-ui";

const [visible, setVisible] = useState(false);
<MobileAccountSheet visible={visible} onVisibleChange={setVisible} />;
// any page rendered inside CubeApp's children
import { ActionButton, ActionIcon, CubePage } from "@hopgoldy/cube-ui";
import { SettingOutlined } from "@ant-design/icons";

const HomePage = () => (
  <CubePage
    desktopHeaderLeft="首页"
    mobileActionBar={
      <>
        <ActionIcon icon={<SettingOutlined />} aria-label="打开设置" />
        <ActionButton>操作</ActionButton>
      </>
    }
  >
    page content
  </CubePage>
);

CubeApp is the single component every app configures: it composes CubeConfigProvider, renders the desktop shell (collapsible sidebar, header, account popover), and exposes the account/about configuration through context so MobileAccountSheet — a mobile-only settings drawer mounted by whichever page needs it, reached through the router's <Outlet/> — renders from the same data without taking it as props. Mobile has no persistent header or sidebar, matching how Cube apps actually behave today — mobile pages are bare content plus whatever action bar the page itself renders.

CubeConfigProvider applies the fixed Cube antd configuration (zh_CN locale, primaryColor token, a larger base font size on mobile) without rendering any shell. Mount it on its own for pages that should follow the Cube theme but live outside CubeApp — no configuration needed:

// a themed page outside the CubeApp shell (login, share, embedded views, ...)
import { CubeConfigProvider } from "@hopgoldy/cube-ui";

export const LoginPage = () => (
  <CubeConfigProvider>
    <LoginForm />
  </CubeConfigProvider>
);

CubePage is the single page-level container every page renders: it lays out scrollable content and an optional mobile-only action bar, and lets the page override CubeApp's header-left slot via desktopHeaderLeft for as long as it stays mounted. ActionIcon and ActionButton are the shared mobile action-bar primitives, matching the pattern already used in cube-xxx apps.

This package is intentionally UI-only. It does not depend on routers, HTTP clients, application stores, or authentication logic.