the-toast
Toast of the-components
Installation
$ npm install the-toast --save
Usage
Live Demo is hosted on GitHub Page
'use strict' PureComponent { superprops thisstate = messages: normal: 'This is normal' 'This is normal 2' info: 'This is info' 'This is info 2' warn: 'This is warn' 'This is warn 2' error: 'This is error' 'This is error 2' } { const messages = thisstate const onUpdate = this return <ReactStrictMode> <div> <TheToastStyle /> <TheToastGroup> <TheToastNormal onUpdate=onUpdate messages=messagesnormal /> <TheToastInfo onUpdate=onUpdate messages=messagesinfo clearAfter=1200 /> <TheToastWarn onUpdate=onUpdate messages=messageswarn /> <TheToastError onUpdate=onUpdate messages=messageserror /> </TheToastGroup> </div> </ReactStrictMode> }
Components
TheToast
Toast of the-components
Props
Name | Type | Description | Default |
---|---|---|---|
clearAfter |
number | Clear message after seconds | -1 |
level |
enum | Level of toast | 'normal' |
messages |
arrayOf node | Messages to show | `` |
onUpdate |
func | Handle update | `` |
role |
'alert' |
||
transitionTimeout |
100 |
TheToastGroup
ToastGroup
TheToastStyle
Style for TheToast
Props
Name | Type | Description | Default |
---|---|---|---|
options |
object | Style options | {} |
License
This software is released under the MIT License.