ToastContainer
The brains behind the operation, a wrapper around an event driven architecture which is fast, responsive and performant. Accepts the following props:
Props
The ToastContainer component accepts the same parameters as the toast function, and additionally receives other global props (margin, limit and newestOnTop):
type:
"default"|"success"|"warning"|"error"|"info"The type of the toast, it provides a visual cue as to the nature of the message.
theme:
"filled"|"outlined"|"glass"The theme of the toast.
animation:
"pop"|"fade"|"slide"The type of animation used to animate the toast in and out of the screen.
autoClose:
false|numberThe period after which a toast should automatically close.
closeOnClick:
booleanIf
truethe toast is clickable anywhere on its surface, a click causes the toast to close.limit:
false|numberThe maximum amount of toasts displayed in a single position on the screen, when the limit is reached, the toasts are enqueued and shown when a free spot is available.
margin:
"normal"|"dense"This controls the distance between the edge of the screen and the displayed toast.
newestOnTop:
booleanDisplay the newest toasts on top.
pauseOnHover:
booleanIf
truethe user can pause the countdown of the autoClose period.position:
"top-left"|"top-center"|"top-right"|"bottom-left"|"bottom-center"|"bottom-right"THe toasts list position on the screen.
showCloseButton:
booleanIf
truethe close button will be visible, this works well withcloseOnClick.showIcon:
booleanEach toast type, except
default, has its ownIcon, this flag controls whether it is visible or not.role:
stringDefines the ARIA role for the toast
elevated:
booleanIf
true, a shadow appears under the toast.fullWidth:
booleanControls how the toast is displayed on the screen, if
truetop toasts will merge into one column and have the width of the screen, the bottom toasts will do the same. Suitable for small screens.