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

@ist-group/commonui-components-react

v1.0.3

Published

A comprehensive React components library with Tailwind CSS integration

Readme

@ist-group/commonui-components-react

A comprehensive React components library with Tailwind CSS integration.

Installation

npm install @ist-group/commonui-components-react

Peer Dependencies

Make sure you have React 18+ installed:

npm install react react-dom

Usage

Basic Setup

Import the design tokens CSS in your application entry point:

import "@ist-group/commonui-components-react/style.css";

CuiApp Component

The CuiApp component provides the main application layout with menu, header, and content areas using a slot pattern (similar to Vue slots):

import { CuiApp, template } from "@ist-group/commonui-components-react";

function App() {
  return (
    <CuiApp
      initialMenuCollapsed={false}
      dashboard={true}
      onMenuToggle={(collapsed) => console.log("Menu:", collapsed)}
    >
      <template.menu>
        <YourMenu />
      </template.menu>
      <template.header>
        <YourHeader />
      </template.header>
      <YourContent />
    </CuiApp>
  );
}

Alternative: Using slot-name Attribute

You can also use the slot-name attribute on child elements:

<CuiApp>
  <div slot-name="menu">
    <YourMenu />
  </div>
  <div slot-name="header">
    <YourHeader />
  </div>
  <YourContent />
</CuiApp>

Using the App Context

Access app state and methods in any descendant component:

import { useCuiApp } from "@ist-group/commonui-components-react";

function MyComponent() {
  const { isMenuCollapsed, toggleMenu, isMobile, breadcrumbItems } =
    useCuiApp();

  return (
    <button onClick={toggleMenu}>
      {isMenuCollapsed ? "Open Menu" : "Close Menu"}
    </button>
  );
}

Optional Context Access

For components that work both inside and outside CuiApp:

import { useCuiAppOptional } from "@ist-group/commonui-components-react";

function FlexibleComponent() {
  const appContext = useCuiAppOptional();

  // Safe to use outside CuiApp
  const isMobile = appContext?.isMobile ?? false;

  return <div>{isMobile ? "Mobile View" : "Desktop View"}</div>;
}

Slots

CuiApp uses the @beqa/react-slots library for Vue-like slot support:

| Slot | Description | | --------- | ---------------------------- | | menu | Navigation menu content | | header | Header content | | default | Main content area (children) |

Creating Custom Slot Components

You can use the re-exported slot utilities to create your own slotted components:

import {
  createTemplate,
  useSlot,
  Slot,
  SlotChildren,
} from "@ist-group/commonui-components-react";

type MyComponentSlots = SlotChildren<Slot<"header"> | Slot<"footer"> | Slot>;

const myTemplate = createTemplate<MyComponentSlots>();

function MyComponent({ children }: { children: MyComponentSlots }) {
  const { slot } = useSlot(children);

  return (
    <div>
      <slot.header />
      <slot.default />
      <slot.footer />
    </div>
  );
}

Props

CuiApp Props

| Prop | Type | Default | Description | | ---------------------- | ----------------------------------- | ------- | ----------------------------------- | | initialMenuCollapsed | boolean | false | Initial collapsed state of the menu | | breadcrumbItems | BreadcrumbItem[] | [] | Initial breadcrumb items | | mobileBreakpoint | number | 768 | Mobile breakpoint in pixels | | dashboard | boolean | false | Dashboard mode (gray background) | | onMenuToggle | (collapsed: boolean) => void | - | Called when menu state changes | | onViewportChange | (isMobile: boolean) => void | - | Called on viewport changes | | onBreadcrumbsUpdate | (items: BreadcrumbItem[]) => void | - | Called when breadcrumbs update | | children | CuiAppSlots | - | Slotted content |

BreadcrumbItem

interface BreadcrumbItem {
  key?: string;
  label: string;
  href?: string;
  disabled?: boolean;
  data?: unknown;
}

Context Value

The useCuiApp() hook returns:

| Property | Type | Description | | ------------------- | ----------------------------------- | ----------------------------- | | isMenuCollapsed | boolean | Current menu collapsed state | | isMobile | boolean | Current mobile viewport state | | isDashboard | boolean | Current dashboard mode state | | breadcrumbItems | BreadcrumbItem[] | Current breadcrumb items | | toggleMenu | () => void | Toggle menu state | | closeMenu | () => void | Close (collapse) the menu | | updateBreadcrumbs | (items: BreadcrumbItem[]) => void | Replace all breadcrumbs | | addBreadcrumb | (item: BreadcrumbItem) => void | Add breadcrumb to end | | popBreadcrumb | () => void | Remove last breadcrumb | | clearBreadcrumbs | () => void | Clear all breadcrumbs |

License

MIT