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.
npm install react-toast-craft
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.
ToastProvider
from react-toast-craft
.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>
);
This package supports several toast notification types. You can choose one of these based on the context of your message.
success
: Displays a toast with a green background indicating success.error
: Displays a toast with a red background indicating an error.info
: Displays a toast with a blue background indicating information.