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

@revoui/alert

v2.0.19

Published

A collection of alert components for the RevoUI library.

Readme

@revoui/alert

A collection of versatile and customizable Alert and Notification components for React applications, part of the main Revo UI library.

These components are built on a single, flexible base component (MyAlert) and provide simplified wrappers for common alert types, making it easy to implement both static and dynamic alerts in your projects.


📦 Installation

Install the package via npm:

npm install @revoui/alert

🚀 Usage

The library provides five main exported components:

  • Four pre-configured wrappers (static usage).
  • One controller component (Alert) for dynamic, state-managed notifications.

1. Pre-configured Wrappers (Static Usage)

Use the wrappers (SuccessAlert, WarningAlert, ErrorAlert, etc.) for quick, self-contained alerts.

import { SuccessAlert, WarningAlert, ErrorAlert } from '@revoui/alert';

export default function StaticAlertExample() {
  return (
    <div className="space-y-4 p-6">
      <SuccessAlert
        title="Configuration Saved"
        message="Your new preferences have been successfully stored."
        shadow="lg"
      />
      <WarningAlert
        title="Check Required"
        message="A payment transaction is pending and requires immediate attention."
        rounded="xl"
      />
      <ErrorAlert
        title="Critical Failure"
        message="The server failed to respond due to a permissions issue."
        className="border border-red-300"
      />
    </div>
  );
}

2. Dynamic Controller (Alert)

Use the Alert component for state-controlled alerts, ideal for notifications triggered by user actions or async operations.

import React, { useState } from 'react';
import { Alert, AlertProps } from '@revoui/alert';

type DynamicAlertState = Omit<AlertProps, 'message'> & {
  message?: string;
  type?: MyAlertProps['type'];
};

export default function DynamicAlertExample() {
  const [alertState, setAlertState] = useState<DynamicAlertState>({ message: '' });

  const showSuccessAlert = () => {
    setAlertState({
      type: "success",
      title: "Action Complete",
      message: "Data synchronization finished successfully.",
    });
    setTimeout(() => setAlertState({ message: '' }), 4000);
  };

  return (
    <div>
      <Alert alertState={alertState} setAlert={setAlertState} />
      <button onClick={showSuccessAlert}>
        Show Dynamic Success Alert
      </button>
    </div>
  );
}

🎨 Alert Types and Defaults

The type prop (or wrapper used) determines default colors and icons.

| Type | Wrapper | Icon Color | Background Color | Purpose | | -------- | ------------- | ----------- | ---------------- | --------------------------- | | success | SuccessAlert | green-500 | green-100 | Positive confirmation. | | danger | ErrorAlert | red-500 | red-100 | Critical failure/error. | | required | RequiredAlert | red-500 | red-100 | Strong emphasis/validation. | | warning | WarningAlert | amber-500 | amber-100 | Non-critical advisory. | | info | - | blue-500 | blue-100 | Neutral information. | | default | - | gray-500 | gray-100 | Generic notification. |


🧩 Components

| Component | Description | | ------------ | -------------------------------------------------------------------------------------- | | MyAlert | The core display component. Renders the icon, title, and message. | | Alert | The controller component. Uses alertState + setAlert to render alerts dynamically. | | Wrappers | Pre-configured: SuccessAlert, ErrorAlert, WarningAlert, RequiredAlert. |


⚙️ Props

AlertProps (Wrappers)

Props available in all pre-configured alerts:

| Prop | Type | Default | Description | | ----------- | --------------------- | ------- | ---------------------------- | | message | string \| ReactNode | – | Alert content. | | title | string | – | Optional header text. | | className | string | – | Custom Tailwind classes. | | color | string | white | Overrides background color. | | shadow | string | – | Tailwind shadow (e.g. md). | | rounded | string | lg | Border radius style. | | textColor | string | – | Override text color. | | iconColor | string | – | Override icon color. | | iconBg | string | – | Override icon background. | | iconRound | string | full | Border radius for icon. |

MyAlertProps (Base Component)

Extends AlertProps with an explicit type:

| Prop | Type | Default | Description | | ------ | ----------- | --------- | ------------------------------------------------------------------------------------ | | type | AlertType | warning | Defines alert style (success, info, danger, required, warning, default). |


🔧 Customization

Easily override defaults with iconColor, iconBg, and textColor.

<RequiredAlert 
  title="Custom Branding" 
  message="This alert uses custom purple styling."
  iconColor="purple-600"
  iconBg="purple-100"
  textColor="purple-800"
/>

📄 License

Licensed under the MIT License.


👥 Author

Revoui Team