3.0.3 β€’ Published 3 months ago

react-toastified v3.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

npm Made by Justin Charo npm version npm NPM

🍞✨ React-Toastified β€” Get Your Notifications Toasty!

Elevate the UX of your React apps with toasts that are as informative as they are delicious.


πŸš€ Quick Intro

Why settle for boring alerts when you can have toast? React-Toastified serves up a feast of eye-catching notifications with zero hassle. Hover over and feel the warmth of our interactive toasts. More style, less stress. Let's get toastified! πŸ₯‚


πŸ”₯ What’s Cooking?

  • πŸŽ‰ Flavorsome Toast Types: Success, Error, Warning, and Info.
  • 🌌 Hover & Glow: Experience the magical hover effect that makes your notifications pop!
  • πŸ‘” Tailor-Made: Spice up your toasts with custom styles, durations, and more.
  • πŸ› οΈ Plug 'n' Play: Pairs perfectly with any React dish.

πŸ“¦ Pantry Essentials (Installation)

You can add this package to your project using npm or yarn:

npm install react-toastified

# or if you're a yarn fan

yarn add react-toastified

πŸ› οΈ Cooking Time (Usage)

Before cooking up some toasts, wrap your root component in ToastProvider.

import App from "./App";
import { ToastProvider } from "react-toastified";

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <React.StrictMode>
    <ToastProvider>
      <App />
    </ToastProvider>
  </React.StrictMode>
);

🍞 Basic Toast Recipe

Triggering a simple info toast is as easy as pie!

import { useToast } from "react-toastified";

function MyComponent() {
  const { addToast } = useToast();

  const handleClick = () => {
    addToast("Hey, check this out! Info toast, coming right up!");
  };

  return <button onClick={handleClick}>Serve Toast</button>;
}

🌈 Rainbow of Toasts

Why stick to one flavor when you can have them all? 🌈

function MyComponent() {
  const { addToast } = useToast();
  const toastTypes = ["info", "success", "error", "warning"];

  const handleClick = (type) => {
    addToast(`A fresh ${type} toast, just for you!`, {
      type,
      position:"bottom-right" // Default is bottom-right , full list of position arguments  are ['bottom-right', 'bottom-left', 'top-left', 'top-right']
      style: {
        color: "black",
        // backgroundColor: "pink", // Add some flair with custom styles
        // padding: "24px"
      },
    });
  };

  return (
    <>
      {toastTypes.map((type) => (
        <button onClick={() => handleClick(type)}>Serve {type} Toast</button>
      ))}
    </>
  );
}

🎨 Garnish Your Toast

Add some jazz to your toasts with custom options.

import { useToast } from "react-toastified";

const { addToast } = useToast();
addToast("Yay! You did it!", { type: "success" });
addToast("Oops! Something went wrong.", { type: "error" });

🌈 Coming Up Next!

  • πŸš€ Action buttons for your toasts
  • 🎨 Even more ways to customize

🀝 Share Your Recipes (Contributions)

If you’ve got some zesty ideas, we’re all ears! Issue reports, feature requests, and contributions are always welcome. Let's make some toast magic together!


πŸ’Œ Lovingly baked by @jcharo, seasoned with inspiration from Vercel Notification.

Also Check Out My Other Package 🌟

Interested in displaying GitHub activity in a stylish calendar format within your React apps? Check out my other package, React GitHub Activity Calendar!

React GitHub Activity Calendar Screenshot

It's a simple and customizable React component for showing GitHub activity. To learn more about how to use it and integrate it into your projects, head over to the official documentation.

3.0.3

3 months ago

3.0.1

3 months ago

3.0.0

3 months ago

1.1.9

7 months ago

1.3.6

7 months ago

1.1.8

7 months ago

1.3.5

7 months ago

1.1.7

7 months ago

1.3.4

7 months ago

1.1.6

7 months ago

1.3.3

7 months ago

1.1.5

7 months ago

1.3.2

7 months ago

1.1.4

7 months ago

1.3.1

7 months ago

1.1.3

7 months ago

1.3.0

7 months ago

1.1.12

7 months ago

1.1.11

7 months ago

1.1.14

7 months ago

1.1.13

7 months ago

1.3.8

7 months ago

1.2.14

7 months ago

1.2.15

7 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.10

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.6

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago