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

modern-react-ui-components

v1.6.0

Published

Modern React + TypeScript component library with Toaster, Input, and DatePicker components

Downloads

26

Readme

Modern React UI Components

npm version License: MIT

A modern, reusable React + TypeScript component library featuring Toaster, Input, and DatePicker components with beautiful design and accessibility features.

📦 NPM Package

This component library is now published on npm!

npm install modern-react-ui-components

👉 View complete NPM usage guide for installation instructions, import examples, and detailed prop documentation.

🚀 Features

  • Modern React + TypeScript: Built with latest React 18 and TypeScript for type safety
  • Accessible: Full ARIA support and keyboard navigation
  • Customizable: Multiple sizes, states, and styling options
  • Tree-shakeable: ESM + CommonJS bundles for optimal performance
  • CSS Modules: Scoped styling to prevent conflicts

📦 Local Development Installation

For local development of this library:

npm install
# or
yarn install
# or
pnpm install

For using the published package in your project, see the NPM Usage Guide.

🧩 Components

Toaster

Interactive toast notifications with four different states:

// For NPM package usage:
import { Toaster, ToasterWithSpecs } from 'modern-react-ui-components';
import 'modern-react-ui-components/dist/style.css';

// For local development:
// import { Toaster, ToasterWithSpecs } from './src/components';

function App() {
  return (
    <div>
      {/* Individual toaster */}
      <Toaster
        type="success"
        message="Operation completed successfully!"
        onDismiss={() => console.log('dismissed')}
        autoHide={true}
        autoHideDelay={5000}
      />

      {/* Toaster with measurement specifications */}
      <ToasterWithSpecs
        type="success"
        message="We just released something new!"
        showSpecs={true}
      />
    </div>
  );
}

Toaster Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | type | 'success' \| 'failed' \| 'info' \| 'attention' | - | Toast type/state | | message | string | - | Toast message content | | onDismiss | () => void | - | Callback when toast is dismissed | | autoHide | boolean | true | Auto-hide the toast | | autoHideDelay | number | 5000 | Auto-hide delay in milliseconds | | className | string | - | Additional CSS class |

Color Tokens

| State | Background Color | Icon Color | |-------|------------------|------------| | Success | #A6F5D6 | #003134 | | Failed | #FAADAC | #003134 | | Info | #CCFFFF | #003134 | | Attention | #FFEBAD | #003134 |

Input

Form input component with multiple states and accessibility features:

// For NPM package usage:
import { Input } from 'modern-react-ui-components';
import 'modern-react-ui-components/dist/style.css';

// For local development:
// import { Input } from './src/components';

function MyForm() {
  const [value, setValue] = useState('');

  return (
    <Input
      label="Email Address"
      placeholder="Enter your email"
      helperText="We'll never share your email"
      errorText={value.includes('@') ? '' : 'Please enter a valid email'}
      size="medium"
      value={value}
      onChange={(e) => setValue(e.target.value)}
      fullWidth
    />
  );
}

Input Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | label | string | - | Input label | | helperText | string | - | Helper text below input | | errorText | string | - | Error message (overrides helperText) | | size | 'small' \| 'medium' \| 'large' | 'medium' | Input size variant | | state | 'default' \| 'hover' \| 'focus' \| 'active' \| 'error' \| 'disabled' | - | Force specific state | | fullWidth | boolean | false | Make input full width | | disabled | boolean | false | Disable the input |

State Colors

| State | Border Color | |-------|--------------| | Default/Active | #555555 | | Hover | #003134 | | Focus | #007173 | | Error | #C4221F | | Disabled | #555555 |

🎨 Preview

Run the preview application to see all components in action:

# Install dependencies
npm install

# Install preview dependencies
npm run preview:install

# Run preview
npm run preview

🏗️ Development

# Install dependencies
npm install

# Build the library
npm run build

# Run type checking
npm run type-check

# Run linting
npm run lint

# Watch mode for development
npm run dev

📁 Project Structure

├── src/
│   ├── components/
│   │   ├── Toaster/
│   │   │   ├── Toaster.tsx
│   │   │   ├── Toaster.module.css
│   │   │   ├── ToastContainer.tsx
│   │   │   └── ToastContainer.module.css
│   │   └── Input/
│   │       ├── Input.tsx
│   │       └── Input.module.css
│   └── index.ts
├── preview/          # Preview application
├── dist/            # Built library (after npm run build)
└── package.json

📤 Publishing

  1. Build the library:

    npm run build
  2. Update version in package.json

  3. Login to npm (if not already logged in):

    npm login
  4. Publish to npm:

    npm publish --access public

🔧 Bundle Information

  • ESM: dist/index.es.js
  • CommonJS: dist/index.cjs.js
  • Types: dist/index.d.ts
  • CSS: Bundled with components using CSS Modules

🎯 Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

📄 License

MIT License - see LICENSE file for details.

🤝 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

📞 Support

For support, please open an issue in the GitHub repository.