npm install react-toasterReact-toaster
=========
A toast style message tip of React
npm install react-toaster --save-dev
javascript
var Demo = React.createClass({
displayName: 'ReactToasterDemo',
onShow: function(){
this.refs.toast.show('Hei, hei');
},
onHide: function(){
this.refs.toast.hide();
},
render: function(){
return (
);
}
});
`
* Configuration:`javascript
// css
{
width: '55%',
left: '20%',
top: '40%',
color: '#fff',
background: 'rgba(0, 0, 0, 0.5)',
opacity: .8,
zIndex: 9999,
fontSize: '20px'
}// props
{
auto: true, // auto hide or not,
duration: 2000, // hide timeout
modal: false, // modal or not
}
// usage
`
* Methods
`javascript
show:
Show the toast with content;
hide:
Hide the toast manually.
``* 0.0.1
* It's the simplest implementation.
* 0.0.2
* add fontSize property and update doc.
* 0.0.3
* support modal;
* extract style custom with css props.