
These are useful to show when you are performing asynchronous actions such as loading or saving
data.
API
TypeScript
Returns
APromise
that resolves to an object containing:
By calling
hideToast()
you can imperatively hide the toast.Useful if your toast was showing a “loading” or “saving” message.
Options
The title of the toast.
The text of the toast.
An optional action button that can execute code if and when the user triggers it.
How long to keep the toast open.Defaults to
4_000
(four seconds)If you want the toast to remain open indefinitely, you can pass
Number.POSITIVE_INFINITY
.Only do this if you do not have
dismissable
set to false
!Whether or not to allow the user to dismiss the toast.Defaults to
true
.