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

@cp949/mui

v2.0.11

Published

CP949 MUI React component library

Readme

@cp949/mui

npm version TypeScript License: MIT

A comprehensive React component library built on Material-UI, providing 50+ production-ready components and 67+ custom hooks for modern React applications.

✨ Features

  • 🎨 50+ Components: Layout, interactive, responsive, and utility components
  • ⚡ 67+ Custom Hooks: State management, event handling, storage, observables, and more
  • 📱 Responsive Design: Built-in breakpoint components and utilities
  • 🔧 TypeScript First: Full TypeScript support with comprehensive type definitions
  • ⚛️ React 18/19: Compatible with both React 18 and 19
  • 🏗️ Material-UI v7: Built on top of the latest Material-UI
  • 📦 Tree Shakable: Optimized bundle size with ES modules
  • 🎯 Multiple Entry Points: Import from main, hooks, or helpers separately
  • 🚀 Zero Config: All utilities included - no additional dependencies required

📦 Installation

Just one command and you're ready to go! All utilities are included.

# npm
npm install @cp949/mui

# yarn
yarn add @cp949/mui

# pnpm
pnpm add @cp949/mui

Peer Dependencies

Make sure you have the following peer dependencies installed:

npm install @mui/material @mui/system react rxjs

✨ That's it! No need to install additional utility libraries - everything you need is included.

🚀 Quick Start

import React from 'react';
import { FlexRow, Center, DebouncedButton } from '@cp949/mui';
import { useLocalStorage, useDebouncedState } from '@cp949/mui/hooks';

function MyApp() {
  const [theme, setTheme] = useLocalStorage('theme', 'light');
  const [searchQuery, setSearchQuery] = useDebouncedState('', 300);

  return (
    <FlexRow spacing={2} sx={{ p: 2 }}>
      <Center sx={{ minHeight: 200, bgcolor: 'background.paper' }}>
        <DebouncedButton
          variant="contained"
          onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
        >
          Toggle Theme: {theme}
        </DebouncedButton>
      </Center>
    </FlexRow>
  );
}

📚 Component Categories

Layout Components

Perfect for building responsive layouts with flexbox and grid systems:

import { FlexRow, FlexColumn, StackRow, Center, Space } from '@cp949/mui';

// Flexible layouts
<FlexRow spacing={2} alignItems="center">
  <FlexColumn.Start>Content</FlexColumn.Start>
  <FlexRow.Between>Navigation</FlexRow.Between>
</FlexRow>

// Centering utilities
<Center vertical sx={{ height: '100vh' }}>
  <h1>Perfectly Centered</h1>
</Center>

// Spacing control
<Space y={4} /> // Vertical spacing
<Space x={2} /> // Horizontal spacing

Interactive Components

Enhanced Material-UI components with additional functionality:

import { DebouncedButton, SegmentedControl, FloatingIndicator } from '@cp949/mui';

// Debounced interactions
<DebouncedButton
  debounce={500}
  onClick={handleSearch}
  variant="contained"
>
  Search
</DebouncedButton>

// Modern segmented controls
<SegmentedControl
  value={selectedTab}
  onChange={setSelectedTab}
  data={[
    { label: 'React', value: 'react' },
    { label: 'Vue', value: 'vue' },
    { label: 'Angular', value: 'angular' }
  ]}
/>

Responsive Components

Breakpoint-aware components for responsive design:

import { SmOrUp, MdOrDown, LgOrUp, Hide, Show } from '@cp949/mui';

// Conditional rendering based on screen size
<SmOrUp>
  <DesktopNavigation />
</SmOrUp>

<MdOrDown>
  <MobileNavigation />
</MdOrDown>

// Conditional visibility
<Show when={isLoggedIn}>
  <UserProfile />
</Show>

<Hide when={isLoading}>
  <MainContent />
</Hide>

Utility Components

Specialized components for common use cases:

import { Portlet, Highlight, FileButton, CopyButtonWrapper } from '@cp949/mui';

// Card-like containers
<Portlet>
  <Portlet.Header>
    <Portlet.Label>User Settings</Portlet.Label>
    <Portlet.Toolbar>
      <Button>Edit</Button>
    </Portlet.Toolbar>
  </Portlet.Header>
  <Portlet.Content>
    Form content here
  </Portlet.Content>
  <Portlet.Footer>
    Action buttons
  </Portlet.Footer>
</Portlet>

// Text highlighting
<Highlight searchValue="React" highlightColor="primary.main">
  React is a JavaScript library for building user interfaces
</Highlight>

🎣 Custom Hooks

State Management Hooks

import {
  useDebouncedState,
  useLocalStorage,
  useUncontrolled,
  useObservable
} from '@cp949/mui/hooks';

// Debounced state updates
const [searchTerm, setSearchTerm] = useDebouncedState('', 300);

// Persistent storage
const [user, setUser] = useLocalStorage('user', null);

// Controlled/uncontrolled pattern
const [value, setValue] = useUncontrolled({
  value: controlledValue,
  defaultValue: 'default',
  onChange: onControlledChange
});

// RxJS Observable integration
const data = useObservable(dataStream$);

Event & Effect Hooks

import {
  useEventListener,
  useWindowSize,
  useElementSize,
  useInterval,
  useTimeout
} from '@cp949/mui/hooks';

// Event handling
useEventListener('keydown', handleKeyPress);

// Responsive utilities
const { width, height } = useWindowSize();
const { width: elWidth } = useElementSize(elementRef);

// Timing utilities
useInterval(() => {
  fetchData();
}, 5000);

const [showNotification] = useTimeout(() => {
  setVisible(false);
}, 3000);

Lifecycle & Performance Hooks

import {
  useMount,
  useUnmount,
  useUpdateEffect,
  useDeepCompareEffect,
  useThrottledCallback
} from '@cp949/mui/hooks';

// Lifecycle
useMount(() => {
  initializeApp();
});

useUnmount(() => {
  cleanup();
});

// Performance optimization
const throttledHandler = useThrottledCallback(
  handleScroll,
  100
);

useDeepCompareEffect(() => {
  fetchData();
}, [complexObject]);

🛠️ Helper Utilities

import { muiCssVars, muiMediaQueries } from '@cp949/mui/helper';

// CSS custom properties for theming
const styles = {
  color: muiCssVars.palette.primary.main,
  spacing: muiCssVars.spacing(2)
};

// Media query utilities
const isTablet = muiMediaQueries.up('md');

📖 API Reference

Multiple Entry Points

The library provides optimized entry points for different use cases:

// Main components and utilities
import { FlexRow, Center, DebouncedButton } from '@cp949/mui';

// Hooks only (smaller bundle)
import { useLocalStorage, useDebouncedState } from '@cp949/mui/hooks';

// Helper utilities only
import { muiCssVars, muiMediaQueries } from '@cp949/mui/helper';

TypeScript Support

All components and hooks come with comprehensive TypeScript definitions:

import type { FlexRowProps, CenterProps, DebouncedButtonProps } from '@cp949/mui';

// Fully typed component props
const MyComponent: React.FC<FlexRowProps> = ({ spacing, children, ...props }) => {
  return <FlexRow spacing={spacing} {...props}>{children}</FlexRow>;
};

🔧 Requirements

  • React: ^18.0.0 || ^19.0.0
  • Material-UI: ^7.0.0
  • TypeScript: ^5.0.0 (recommended)
  • Node.js: >=18.0.0

📄 License

MIT © CP949

🤝 Contributing

This is an internal library. For bug reports or feature requests, please contact the maintainers.


Built with ❤️ using Material-UI and TypeScript