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

@azul-marino000080/rw-notifications

v1.0.3

Published

Sistema de notificaciones para aplicaciones React

Readme

RW Notifications

Sistema de notificaciones para aplicaciones React. Librería ligera y personalizable para mostrar toast notifications.

📦 Instalación

npm install rw-notifications

🚀 Uso Básico

1. Configurar el Provider

Envuelve tu aplicación con el NotificationProvider:

import { NotificationProvider } from 'rw-notifications';

function App() {
  return (
    <NotificationProvider>
      <div className="App">
        {/* Tu aplicación */}
      </div>
    </NotificationProvider>
  );
}

2. Usar las notificaciones

import { useNotifications } from 'rw-notifications';

function MyComponent() {
  const { success, error, warning, info } = useNotifications();

  const handleSuccess = () => {
    success('¡Operación completada exitosamente!');
  };

  const handleError = () => {
    error('Error al procesar la solicitud');
  };

  return (
    <div>
      <button onClick={handleSuccess}>Mostrar éxito</button>
      <button onClick={handleError}>Mostrar error</button>
    </div>
  );
}

⚙️ Configuración

Configuración del Provider

<NotificationProvider 
  config={{
    duration: 5000,           // Duración en ms (0 = permanente)
    position: 'top-right',    // Posición de las notificaciones
    maxNotifications: 3       // Máximo número de notificaciones
  }}
>
  <App />
</NotificationProvider>

Posiciones disponibles

  • top-right (por defecto)
  • top-left
  • top-center
  • bottom-right
  • bottom-left
  • bottom-center

Configuración por notificación

const { addNotification } = useNotifications();

addNotification('Mensaje personalizado', 'success', {
  duration: 10000,  // Duración específica para esta notificación
});

🎨 Tipos de Notificación

const { success, error, warning, info, addNotification } = useNotifications();

// Métodos directos
success('Operación exitosa');
error('Error ocurrido');
warning('Advertencia importante');
info('Información relevante');

// Método genérico
addNotification('Mensaje', 'success');
addNotification('Mensaje', 'error');
addNotification('Mensaje', 'warning');
addNotification('Mensaje', 'info');

🎯 API Completa

Hook useNotifications

const {
  // Métodos para mostrar notificaciones
  success,              // (message, config?) => id
  error,                // (message, config?) => id
  warning,              // (message, config?) => id
  info,                 // (message, config?) => id
  addNotification,      // (message, type, config?) => id
  
  // Métodos de control
  removeNotification,   // (id) => void
  clearAllNotifications, // () => void
  
  // Estado
  notifications,        // Array de notificaciones activas
  config               // Configuración actual
} = useNotifications();

Configuración

{
  duration: 4000,         // Duración en milisegundos
  position: 'top-right', // Posición en pantalla
  maxNotifications: 5    // Máximo de notificaciones simultáneas
}

🎨 Personalización de Estilos

La librería incluye estilos CSS que puedes personalizar mediante variables CSS:

:root {
  --rw-notification-success-bg: #10b981;
  --rw-notification-error-bg: #ef4444;
  --rw-notification-warning-bg: #f59e0b;
  --rw-notification-info-bg: #3b82f6;
  --rw-notification-border-radius: 8px;
  --rw-notification-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  /* ... más variables disponibles */
}

📱 Responsive

Las notificaciones son completamente responsive y se adaptan automáticamente a dispositivos móviles.

🔧 Desarrollo

# Instalar dependencias
npm install

# Construir la librería
npm run build

# Preparar para publicación
npm run prepublishOnly

📝 Licencia

MIT

🤝 Contribuir

Las contribuciones son bienvenidas. Por favor:

  1. Fork el proyecto
  2. Crea una rama para tu feature
  3. Commit tus cambios
  4. Push a la rama
  5. Abre un Pull Request

📞 Soporte

Si tienes problemas o preguntas, abre un issue en el repositorio de GitHub.


RW Notifications - Parte del ecosistema RW para desarrollo web.