Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ajoelp/toast

Toast message library for react.
https://github.com/ajoelp/toast

react tailwind toast

Last synced: 9 days ago
JSON representation

Toast message library for react.

Awesome Lists containing this project

README

        

# React Toast Notifications
![npm](https://img.shields.io/npm/v/@ajoelp/toast)
![Test](https://github.com/ajoelp/toast/workflows/Test/badge.svg?branch=main)

## Getting Started

```sh
npm install @ajoelp/toast
```

Install the toast wrapper in your root app file.

```jsx
import React from 'react';
import { ToastWrapper } from '@ajoelp/toast';

function App(){
return
}
```

Trigger toast notifications from anywhere in your application

```jsx
import { toast } from '@ajoelp/toast';

toast("This is the toast message", {
type: 'success' | 'error' | 'info' | 'warning',
isHtml: true,
delay: 1500
})

// Or use the typed helpers

toast.info("This is the toast message")
toast.success("This is the toast message")
toast.error("This is the toast message")
toast.warning("This is the toast message")

```

Override the toast message component

```jsx
import React from 'react';
import { ToastWrapper } from '@ajoelp/toast';

function CustomContainer({ close, message, active, options}){
return (

{message}


)
}

function App(){
return
}
```