A simple, customizable, and easy-to-use React library for displaying toast notifications. It allows you to show notifications with various styles, types, and durations, making it perfect for any React application.

Installation

npm install react-toast-craft

Usage

After installation, you need to wrap your App component with the ToastProvider component from react-toast-craft. This will enable the toast notification system in your app.

  1. Import ToastProvider from react-toast-craft.
  2. Wrap the root of your app with ToastProvider.

Example -

import React from 'react';
import { createRoot } from 'react-dom/client';
import ToastProvider from 'react-toast-craft';
import App from './App';

// Rendering the app with ToastProvider at the root
createRoot(document.getElementById('root')).render(
  <ToastProvider>
    <App />
  </ToastProvider>
);

Toast Types

This package supports several toast notification types. You can choose one of these based on the context of your message.