reactjs-toastr
v1.1.0
Published
Toaster for ReactJS
Downloads
545
Maintainers
Readme
#About
Toastr for ReactJS. Lightweight library. Easy to use.
Installation
Install via NPM
npm install reactjs-toastr --save
Example (Live Demo)
Include in React Component file
import React from 'react';
import { connect } from 'react-redux';
import toastr from 'reactjs-toastr';
import 'reactjs-toastr/lib/toast.css';
const mapStateToProps = state => ({
});
const mapDispatchToProps = dispatch => ({
});
class MyComponent extends React.Component {
constructor() {
super();
}
componentDidMount() {
}
render() {
return (
<div>
<p onClick={()=>toastr.success('Success Message', 'Title', {displayDuration:3000})}>Show Success Message</p>
<p onClick={()=>toastr.info('Info Message', '', {displayDuration:0})}>Show Info Message</p>
<p onClick={()=>toastr.error('Error Message', 'Title')}>Show Error Message</p>
<p onClick={()=>toastr.warning('Success Message', '', {width:'600px'})}>Show Warning Message</p>
</div>
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(MyComponent);
Any issue or want more features? Contact me!
This module has been tested under limited scenarios. If you find any issue please feel free to report via one of the below platforms:
Email: [email protected] | Skype: harshxxx3