DEV Community

MD Taseen Khan
MD Taseen Khan

Posted on • Originally published at reactjsexample.com on

A Customizable toast component for React

Alert

A Customizable toast component for React

Customizable toast component for React.

Installation

To start using the library, install it in your project:

npm install alert
Enter fullscreen mode Exit fullscreen mode

Add the <Toaster/> component to your app, this component will take care of rendering all your toasts. After that, you can use the toast() function from anywhere in your app.

import { Toaster, toast } from 'alert';

// ...

const App = () => {
  return (
    <div>
      <Toaster />
      <button onClick={() => toast('This is a toast.')}>Create a toast</button>
    </div>
  );
}
Enter fullscreen mode Exit fullscreen mode

Documentation

You can find out more about the API and implementation soon.

GitHub

View Github

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more