A lighter but better alternative to react-toastify. Customizable, efficient, easy-to-use.
npm install untoastifyreact-toastify for toast notifications in React applications. It's simple to use, with minimal styling, but offers flexibility for easy customization.
import { ToastProvider } from "untoastify";
// then wrap your app component inside the toast provider
< ToastProvider >
< App /> // your app main component
< /ToastProvider >
import { useToast } from "untoastify";
const MyComponent = () => {
const toast = useToast();
const handleClick = () => {
toast.showToast({
message: "Show information toast!",
type: "info",
position: "top-right",
duration: 3000, });
};
return (
< button > onClick={handleClick}> Toast Me < /button >
);
};
export default MyComponent;