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

react-custom-toast-notifications

v1.0.4

Published

A highly customizable toast notification system for React applications

Readme

React Custom Toast Notifications

A highly customizable toast notification system for React applications with smooth animations and extensive styling options.

Features ✨

  • 🎨 Highly Customizable - Extensive styling options with Tailwind CSS support
  • 🚀 Smooth Animations - Polished entrance and exit animations
  • 🔧 TypeScript Support - Built with TypeScript for better developer experience
  • 📱 Responsive - Works seamlessly across all device sizes
  • 🎯 Multiple Positions - 6 different toast positions
  • Lightweight - Minimal bundle size with zero dependencies
  • 🎪 Toast Types - Success, Error, Warning, and Info variants

Installation 📦

npm install react-custom-toast-notifications
# or
yarn add react-custom-toast-notifications
# or
pnpm add react-custom-toast-notifications

Basic Usage 🚀

  1. Wrap your app with ToastProvider:
import { ToastProvider } from 'react-custom-toast-notifications';

function App() {
  return (
    <ToastProvider position="top-right">
      <YourApp />
    </ToastProvider>
  );
}
  1. Use the useToast hook in your components:
import { useToast } from 'react-custom-toast-notifications';

function MyComponent() {
  const { addToast } = useToast();
  
  const showNotification = () => {
    addToast('Operation successful!', {
      type: 'success',
      duration: 5000
    });
  };
  
  return <button onClick={showNotification}>Show Toast</button>;
}

Customization Options ⚙️

Position Options

  • top-right (default)
  • top-left
  • top-center
  • bottom-right
  • bottom-left
  • bottom-center

Toast Types

  • success - For successful operations
  • error - For error messages
  • info - For informational messages
  • warning - For warning alerts

Configuration Interface

interface ToastOptions {
  type?: 'success' | 'error' | 'info' | 'warning';
  duration?: number;
  showIcon?: boolean;
  showCloseButton?: boolean;
  className?: string;
  icon?: React.ComponentType;
  animation?: {
    enter?: string;
    exit?: string;
    duration?: number;
  };
  onClose?: () => void;
  onClick?: () => void;
}

interface ToastProviderProps {
  position?: Position;
  containerClassName?: string;
  maxToasts?: number;
  defaultDuration?: number;
  containerStyle?: React.CSSProperties;
  pauseOnHover?: boolean;
  closeOnClick?: boolean;
}

Advanced Usage 🔧

Custom Styling

// Using Tailwind classes
<ToastProvider
  position="top-right"
  containerClassName="space-y-2 p-4"
>
  <YourApp />
</ToastProvider>

// Custom toast styling
addToast('Custom styled toast!', {
  className: 'bg-purple-500 text-white font-bold rounded-xl',
  showIcon: true,
  duration: 3000
});

Custom Icons

import { CustomIcon } from './icons';

addToast('Message with custom icon', {
  icon: CustomIcon,
  type: 'info'
});

Promise Integration

const { promiseToast } = useToast();

const handleAsyncOperation = async () => {
  await promiseToast(
    asyncOperation(),
    {
      loading: 'Processing...',
      success: 'Operation completed!',
      error: (err) => `Error: ${err.message}`
    }
  );
};

Animation Customization

<ToastProvider
  position="top-right"
  animation={{
    enter: 'slide-in',
    exit: 'fade-out',
    duration: 300
  }}
>
  <YourApp />
</ToastProvider>

Examples 📚

Basic Success Toast

addToast('Successfully saved!', { type: 'success' });

Error Toast with Custom Duration

addToast('Operation failed!', {
  type: 'error',
  duration: 8000,
  showCloseButton: true
});

Info Toast with Custom Icon and Styling

addToast('New update available!', {
  type: 'info',
  icon: UpdateIcon,
  className: 'bg-blue-100 border-l-4 border-blue-500'
});

Browser Support 🌐

  • Chrome >= 60
  • Firefox >= 60
  • Safari >= 12
  • Edge >= 79

Contributing 🤝

Contributions are always welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License 📄

This project is licensed under the MIT License

Support 💬

Credits 🙏

Developed and maintained by malicious-dev

Changelog 📝

See CHANGELOG.md for details.