use npm
$ npm install ppeerit-react-toast --save// ES6
// ReactToast is a react component,you can add the ReactToast component in the higher dom node
// toast is a object that has some method to dispatch toast
import ReactToast, {toast} from 'ppeerit-react-toast';just do the method
toast.show('i`am a toast!!!');toast.show function has message, type, config attributes
toast.show(message, type, config)
message is the toast content.
the message attribute must be set
type can use this variants:
successrender success style.warningrender warning style.errorrender error style.inforender info style.
config is the config set, it is a object
timeoutafter the time, component will unmount. default value is3000positionthe place where will show the toast. default value isdefaulttoptop space.bottombottom space.defaultmiddle-bottom space.
backgroundColorcustom background-color, it will replacetypeattr's style.textColorcustom color, it will replacetypeattr's style.