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

@bongkow/globalui

v0.0.16

Published

React global alert UI component & hook

Readme

AlertModal - Global React Alert Modal Component

A global alert modal component for React applications that can be triggered from anywhere in your app. Built with TypeScript, Tailwind CSS, and powered by Zustand for global state management.

Key Benefits

  • 🌍 Global Access: Set up once in your root component and use it anywhere in your application
  • 🔄 Centralized State: Powered by Zustand for efficient global state management
  • 🎨 Multiple alert types: success, error, info, and warning
  • 🖼️ Support for custom images
  • 🎯 TypeScript support
  • 🎭 Tailwind CSS Styling: Built with Tailwind CSS for consistent and customizable design
  • 📱 Responsive design
  • Accessibility support

Prerequisites

  • React 18.0.0 or higher
  • Zustand 5.0.0 or higher
  • Tailwind CSS 3.0.0 or higher

Installation

Using npm:

# Install the package and its peer dependencies
npm install @bongkow/globalui zustand@^5.0.0 tailwindcss@^3.0.0

Using yarn:

# Install the package and its peer dependencies
yarn add @bongkow/globalui zustand@^5.0.0 tailwindcss@^3.0.0

Quick Start

  1. Set up the GlobalUIProvider in your root component (e.g., main.tsx or App.tsx):
import { GlobalUIProvider } from '@bongkow/globalui';

function App() {
  return (
    <GlobalUIProvider>
      {/* Your entire application */}
    </GlobalUIProvider>
  );
}
  1. Use the useAlert hook anywhere in your application:
import { useAlert } from '@bongkow/globalui';

// You can use this in any component, at any level of your component tree
function MyComponent() {
  const { showAlert } = useAlert();

  const handleClick = () => {
    showAlert(
      'This is a success message!',
      'Success',
      'optional-image-url.jpg',
      'success'
    );
  };

  return <button onClick={handleClick}>Show Alert</button>;
}

Alert Types

The component supports four types of alerts, each with its own Tailwind CSS styling. If no type is specified, it defaults to a clean white theme:

  • success: Green theme with checkmark icon (bg-green-50, text-green-800)
  • error: Red theme with error icon (bg-red-50, text-red-800)
  • info: Blue theme with information icon (bg-blue-50, text-blue-800)
  • warning: Yellow theme with warning icon (bg-yellow-50, text-yellow-800)
  • default: White theme with black text (bg-white, text-black)

Props

The showAlert function accepts the following parameters:

showAlert(
  message: string,      // Required: The message to display
  title?: string,       // Optional: The alert title
  imgUrl?: string,      // Optional: URL for a custom image
  type?: AlertType      // Optional: 'success' | 'error' | 'info' | 'warning'
)

Styling

The component is built with Tailwind CSS and requires Tailwind CSS to be properly configured in your project.

Tailwind CSS Configuration

Make sure your tailwind.config.js includes the necessary paths:

module.exports = {
  content: [
    // ... your other content paths
    './node_modules/@bongkow/globalui/**/*.{js,ts,jsx,tsx}',
  ],
  // ... rest of your config
}

Development

# Install dependencies
npm install
# or
yarn

# Start development server
npm run dev
# or
yarn dev

# Build the library
npm run build
# or
yarn build

# Run linting
npm run lint
# or
yarn lint

License

MIT © Bongkow