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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-cutify

v1.0.1

Published

A reusable notification library for React applications.

Readme

React Notification Library A lightweight and reusable notification library for React applications, built with TypeScript. Easily manage and display notifications across your application using React's Context API. Features

TypeScript Support: Fully typed interfaces and components for enhanced developer experience.
Context API: Global state management for notifications.
Customizable: Easily extendable notification types and styles.
Hover Functionality: Prevent notifications from auto-dismissing when hovered.
Accessible: ARIA attributes ensure notifications are screen reader-friendly.
Animations: Smooth fade-in and fade-out transitions for better user experience.

Installation Install the library using Bun or npm: Using Bun

bash bun add react-notification-library @dotlottie/react-player

Using npm

bash npm install react-notification-library @dotlottie/react-player

Usage

  1. Wrap Your Application with NotificationProvider To provide the notification context to your application, wrap your root component with the NotificationProvider.

tsx // App.tsx or layout.tsx

import React from "react"; import { NotificationProvider } from "react-notification-library"; import { SomeComponent } from "./SomeComponent";

const App: React.FC = () => { return ( {/* Other components */} ); };

export default App;

  1. Trigger Notifications Using useNotification Hook Use the useNotification hook to trigger notifications from any component within the NotificationProvider.

tsx // SomeComponent.tsx

import React from "react"; import { useNotification } from "react-notification-library";

const SomeComponent: React.FC = () => { const { showNotification } = useNotification();

const handleSuccess = () => { showNotification("Operation was successful!", "success"); };

const handleError = () => { showNotification("Something went wrong.", "failure"); };

const handlePersistent = () => { showNotification( "This is a persistent notification. Please acknowledge.", "goodbye", true ); };

return ( Show Success Show Error Show Persistent ); };

export { SomeComponent };

API NotificationProvider Provides the context for managing notifications. Wrap your application with this provider.

tsx import { NotificationProvider } from "react-notification-library";

const App = () => ( {/* Your application components */} );

useNotification Custom hook to access notification functions. Usage

tsx import { useNotification } from "react-notification-library";

const Component = () => { const { showNotification, removeNotification, notifications } = useNotification();

// Trigger a notification showNotification("Message", "type", true);

// Remove a notification removeNotification(id);

return ( // Your component JSX ); };

Methods

showNotification
    Parameters:
        message (string): The notification message.
        type (NotificationType): The type of notification (success, failure, etc.).
        persistent (boolean, optional): If true, the notification won't auto-dismiss.
    Usage:

    tsx
    showNotification("Data saved successfully!", "success");
    showNotification("Error saving data.", "failure", true);

removeNotification

Parameters:
    id (number): The ID of the notification to remove.
Usage:

tsx
removeNotification(notificationId);

notifications
    Type: NotificationItem[]
    Description: Array of current notifications.

Customization Extending Notification Types You can extend or modify the notification types by updating the NotificationType in the notificationTypes.ts file.

typescript export type NotificationType = | "success" | "failure" | "goodbye" | "removed" | "favourite" | "delete" | "uploaded" | "warning" | "customType"; // Add your custom types here

Styling The library uses CSS Modules for styling the Notification component. You can customize styles by editing the Notification.module.css file.

css /* Notification.module.css */

.notification { /* Existing styles */ }

.fadeIn { /* Fade-in animation */ }

.fadeOut { /* Fade-out animation */ }

.success { border-left: 5px solid #4caf50; }

/* Add styles for your custom types */ .customType { border-left: 5px solid #9c27b0; }

.iconContainer { /* Icon styling */ }

.message { /* Message styling */ }

.closeButton { /* Close button styling */ }

Adding Animations Integrate Lottie animations or other libraries to enhance the visual appeal of notifications. The current implementation uses @dotlottie/react-player for Lottie animations based on notification types. Contributing Contributions are welcome! Please follow these steps:

Fork the Repository
Create a Feature Branch

bash
git checkout -b feature/YourFeature

Commit Your Changes

bash git commit -m "Add your feature"

Push to the Branch

bash git push origin feature/YourFeature

Open a Pull Request

License This project is licensed under the MIT License. Acknowledgements

Built with React and TypeScript.
Animations powered by DotLottie.
Inspired by various open-source notification systems.