React Quick Notify is a modern, customizable toast notification system designed for React applications, providing a clean UI without requiring external CSS frameworks like Tailwind CSS from version 0.1.x onwards. It ships with full TypeScript support, ensuring type safety for developers. The package, currently at version 0.1.20, focuses on lightweight performance, responsiveness, and extensive customizability, including multiple toast types (success, error, warning, info), configurable positioning, auto-dismiss duration, and smooth animations. While it previously utilized Tailwind CSS, recent versions embed their own styling, simplifying integration. It offers a clear API through a `ToastProvider`, `ToastContainer`, and the `useToast` hook, making it straightforward to implement global or component-specific notifications.
npm install react-quick-notifyVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up `ToastProvider` and `ToastContainer` at the root of a React application, and then using the `useToast` hook within a component to display different types of notifications.
Remove any Tailwind CSS configurations specific to `react-quick-notify` classes. Ensure you import the package's built-in CSS: `import 'react-quick-notify/dist/toast.css';`
Add `import 'react-quick-notify/dist/toast.css';` to your main application entry file (e.g., `App.tsx`, `main.ts`, or a global CSS file that's imported).
Ensure your main `App` component or the root of your component tree is wrapped within `<ToastProvider>...</ToastProvider>`.
Place `<ToastContainer />` within your `ToastProvider` wrapper, usually as a direct child of your `App` component.
Install `lucide-react` alongside `react-quick-notify`: `npm install lucide-react` or `yarn add lucide-react`.
Wrap your application, or at least the part where toasts are used, with the `<ToastProvider>...</ToastProvider>` component.
Add `import 'react-quick-notify/dist/toast.css';` to your application's main entry file (e.g., `src/main.tsx` or `src/App.tsx`).
Ensure you are using named imports for all `react-quick-notify` components and hooks: `import { ToastProvider, ToastContainer, useToast } from 'react-quick-notify';`Ensure `useToast` is only called directly inside a React functional component or a custom hook. Also, verify that `react` and `react-dom` are correctly installed and matching the `react-quick-notify` peer dependency requirements (>=16.8.0).