showToast()
Shows a toast to the user

A toast is a subtle, usually temporary, pop-up notification to let the user know that something is happening or has just happened.
These are useful to show when you are performing asynchronous actions such as loading or saving data.
API
Returns
A Promise
that resolves to an object containing:
hideToast: () => Promise<void>
By calling hideToast()
you can imperatively hide the toast.
Options
title : string
The title of the confirm pop-up.
text : string
The text of the confirm pop-up.
action? : { label: string, onClick: () => void }
An optional action button that can execute code if and when the user triggers it.
durationMs? : number
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
.
dismissable
set to false
!dismissable? : boolean
Whether or not to allow the user to dismiss the toast.
Defaults to true
.
Was this page helpful?