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

tmt-toast

v1.0.1

Published

A simple toast notification library

Readme

Toast Library Documentation

This guide will help you understand how to install, configure, and use the Toast Library in your React projects. The Toast Library is a lightweight notification system that supports different types of messages such as success, error, and informational toasts with shadow effects and icons.


Introduction

The Toast Library provides an easy-to-use solution for adding dynamic notifications to your React applications. Notifications are displayed with appropriate icons and styled for better user experience. The library supports:

  1. Success messages with a green tick icon.
  2. Error messages with a red cross icon.
  3. Informational messages with a blue info icon.

Installation

To get started, you need to install the Toast Library via npm. Run the following command in your project directory to install the library:

  1. Ensure you have a React project set up using tools like Vite or Create React App.
  2. Run the installation command for the Toast Library from npm.

Setup

Once installed, you need to configure your application to use the Toast Library. This involves wrapping your application's root component with the ToastProvider. The ToastProvider is responsible for managing the notifications and displaying them when triggered.

Add the ToastProvider to the highest level of your React component tree, typically in the main entry point of your application.


Using the Library

To display notifications, the library provides a custom hook called useToast. This hook allows you to trigger toasts from any component in your application. Follow these steps to use the toast functionality:

  1. Import the useToast hook into your desired component.
  2. Call the addToast function from the hook, passing the message and type of notification you want to display.
  3. Use predefined types like success, error, or info to style the notification appropriately.

Features

  1. Success Toast: Displays a green tick icon with the message for positive feedback or confirmation.
  2. Error Toast: Displays a red cross icon with the message for error or failure.
  3. Info Toast: Displays a blue info icon with the message for general information.

Toasts automatically disappear after a few seconds and include a subtle shadow for visual enhancement.


Customizing the Appearance

The Toast Library uses default styles for icons and shadows. You can override these styles by customizing the CSS in your project. Update the container's position, colors, or animation effects as per your application design.


Publishing Updates

If you make any changes to the Toast Library or extend its features, you can update it for your team or the public. Follow these steps:

  1. Build the library using your build toolchain.
  2. Publish the changes to npm using your npm account.

Support

For questions or issues with the Toast Library, please raise a concern on the official repository or reach out to the maintainer's email provided during the installation process.


By following this guide, you’ll be able to integrate and use the Toast Library effectively in your React applications. Enjoy building dynamic and user-friendly notifications for your project!