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

@opencxh/ui-kit

v3.1.0

Published

Theme-aware UI component library for OpenCXH platform

Readme

@opencxh/ui-kit

A comprehensive, theme-aware UI component library for the OpenCXH platform. Built with React, TypeScript, and Tailwind CSS, this library provides a consistent design system that automatically adapts to your theme configuration.

Features

  • 🎨 Theme-aware: All components automatically adapt to your theme colors and settings
  • 🌙 Dark mode support: Built-in dark mode with automatic color adjustments
  • Accessible: WCAG compliant components with proper ARIA attributes
  • 📱 Responsive: Mobile-first design with responsive breakpoints
  • 🔧 TypeScript: Full TypeScript support with comprehensive type definitions
  • 🎯 Consistent: Unified design language across all components
  • Performance: Optimized for performance with minimal bundle size

Installation

npm install @opencxh/ui-kit
# or
yarn add @opencxh/ui-kit
# or
pnpm add @opencxh/ui-kit

Quick Start

import { Button, TextField, Modal } from '@opencxh/ui-kit';
import { useState } from 'react';

function App() {
  const [isModalOpen, setIsModalOpen] = useState(false);

  return (
    <div>
      <TextField
        label="Email"
        placeholder="Enter your email"
        type="email"
      />
      
      <Button onClick={() => setIsModalOpen(true)}>
        Open Modal
      </Button>
      
      <Modal
        open={isModalOpen}
        onClose={() => setIsModalOpen(false)}
        title="Welcome"
      >
        <p>Hello from the UI kit!</p>
      </Modal>
    </div>
  );
}

Components

Action Components

Button

A versatile button component with multiple variants and states.

<Button variant="primary" size="md">
  Primary Button
</Button>

<Button variant="outline" leftIcon={<PlusIcon />}>
  Add Item
</Button>

<Button loading variant="secondary">
  Loading...
</Button>

Props:

  • variant: 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive'
  • size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
  • fullWidth: boolean
  • loading: boolean
  • leftIcon, rightIcon: React.ReactNode
  • iconOnly: boolean

Input Components

TextField

A comprehensive text input with validation states and icons.

<TextField
  label="Search"
  placeholder="Search..."
  startIcon={<SearchIcon />}
/>

<TextField
  label="Password"
  type="password"
  error="Password is required"
/>

Props:

  • label: string
  • helperText: string
  • error: string
  • size: 'sm' | 'md' | 'lg'
  • fullWidth: boolean
  • startIcon, endIcon: React.ReactNode
  • loading: boolean

Overlay Components

Modal

An accessible modal dialog with focus management.

<Modal
  open={isOpen}
  onClose={() => setIsOpen(false)}
  title="Settings"
  size="lg"
  footer={
    <div className="flex justify-end space-x-2">
      <Button variant="outline" onClick={() => setIsOpen(false)}>
        Cancel
      </Button>
      <Button onClick={handleSave}>
        Save
      </Button>
    </div>
  }
>
  <SettingsForm />
</Modal>

Props:

  • open: boolean
  • onClose: () => void
  • title: string
  • size: 'sm' | 'md' | 'lg' | 'xl' | 'full'
  • closeOnBackdropClick: boolean
  • closeOnEscape: boolean
  • footer: React.ReactNode

Primitive Components

Box

A flexible container component for layout and styling.

<Box padding="md" background="primary" radius="lg">
  Content
</Box>

<Box as="section" padding="lg" shadow="md">
  <h2>Section Title</h2>
  <p>Section content</p>
</Box>

Props:

  • as: keyof JSX.IntrinsicElements
  • padding, margin: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
  • background: 'none' | 'primary' | 'secondary' | 'accent' | 'success' | 'warning' | 'error' | 'info' | 'neutral'
  • radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full'
  • shadow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
  • border: 'none' | 'sm' | 'md' | 'lg'
  • borderColor: theme color names

Theme Integration

The UI kit automatically integrates with the OpenCXH theme system. Components use CSS custom properties that are automatically generated from your theme configuration.

import { initializeTheming } from '@opencxh/ui-kit';

// Initialize with your theme
initializeTheming({
  colors: {
    primary: '#3b82f6',
    secondary: '#6b7280',
    // ... other colors
  },
  components: {
    button: {
      radius: '0.5rem',
      shadow: '0 4px 6px -1px rgb(0 0 0 / 0.1)'
    }
  }
});

Utilities

cn

A utility function for combining class names.

import { cn } from '@opencxh/ui-kit';

const className = cn(
  'base-class',
  condition && 'conditional-class',
  { 'object-class': true }
);

useThemeVariables

A hook that provides theme-aware CSS variables and utilities.

import { useThemeVariables } from '@opencxh/ui-kit';

function MyComponent() {
  const { colors, getBgClass, getTextClass } = useThemeVariables();
  
  return (
    <div className={getBgClass('primary', 50)}>
      <span className={getTextClass('primary', 900)}>
        Themed content
      </span>
    </div>
  );
}

Development

# Install dependencies
pnpm install

# Build the library
pnpm build

# Run in development mode
pnpm dev

# Run tests
pnpm test

# Type check
pnpm type-check

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see the LICENSE file for details.