Skip to main content

Showing a toast

showToast displays a toast and returns a handle for controlling it. If you don’t pass an id, one is generated for you. A toast is a brief, non-blocking message that slides in, stays on screen for a moment, and slides out. Use it for feedback like “Copied!” or “Settings saved”.

Toast handles

The handle returned by showToast refers to the toast after it’s shown. Use it to dismiss the toast early instead of waiting for it to time out.
Pass a stable id when a toast should replace a previous one instead of stacking. This is useful for progress updates that shouldn’t pile up on screen.