Toast
Props
The table below shows the properties of second parameters of toast function
option | description | type | default |
---|---|---|---|
toastId | Toast's unique Id | String | |
position | Position per toast | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | top-center |
containerId | ID shown in the Toast Container Unique ID | String | '' |
pauseOnHover | The Option that sets the timer to stop or not when a hover event occurs | Boolean | true |
icon | The icon to be displayed in the toast. | ReactNode | |
timeOut | Time for toast to disappear | Number | 3000 |
removeTimeOut | Time for toast to remove in List | Number | 200 |
className | Class of per toast | String | '' |
style | Class of per style | Object | {} |
target | Target element where toast will be located | Object | {} |
closeButton | Option to show or hide the close button | Boolean | false |
Handler
toast.setActive : Sets the toast to an active state.
toast.isActive : Get the active state of the toast
toast.disappear : Disappear the toast after a specified time.
toast.pause : Pause the toast timer.
toast.resume : Resume the toast timer.
toast.replace : Replaces the data to be rendered for the toast.
toast.remove : Removes the toast from the list 200ms after it disappears
toast.allClear : Removes all toasts