reactjs-toastify
v1.0.4
Published
React Toast is a library for showing notifications in your app
Downloads
7
Readme
React Toast
React Toast is a library for showing notifications in your app DEMO
Install
npm install --save reactjs-toastify
Usage
import { Fragment } from "react";
import { ToastContainer, Toast } from "reactjs-toastify";
import "reactjs-toast/dist/index.css";
const Example = () => {
const toggle = () => {
Toast({
type= "success",
message = "Lorem Ipsum is simply dummy text of the printing",
})
}
return (
<Fragment>
<button onClick={toggle}>Show Toast</button>
<NotificationContainer />
</Fragment>
);
};
Parameters
| Name | Type | Description |
| -------------- | ------- | :---------------------------------------------------------------: |
| mesage
| Boolean | Content to sjow in the toast |
| type
| String | Type of toast |
| delay
| Number | It will delay the toast apperaence |
| position
| String | Position where will display the toast |
| pauseOnHover
| Boolean | Stops the timer when hover the toast or not |
| closeIcon
| Boolean | Whether to show the close icon or not |
| theme
| String | Determines the theme of the toast |
| color
| String | It will change the default color of the toast (string, rgba, hex) |