Toasts always have a close button. They emit the signal@Toast::dismissed
signal when disappearing.
property@Toast:timeout determines how long the toast stays on screen, while
property@Toast:priority determines how it behaves if another toast is
already being displayed.
Toast titles use Pango markup by default, set property@Toast:use-markup to
FALSE if this is unwanted.
property@Toast:custom-title can be used to replace the title label with a
custom widget.
A helper object for class@ToastOverlay.
Toasts are meant to be passed into adw.toast_overlay.ToastOverlay.addToast as follows:
adw_toast_overlay_add_toast (overlay, adw_toast_new (_("Simple Toast")));
<picture> <source srcset="toast-simple-dark.png" media="(prefers-color-scheme: dark)"> <img src="toast-simple.png" alt="toast-simple"> </picture>
Toasts always have a close button. They emit the signal@Toast::dismissed signal when disappearing.
property@Toast:timeout determines how long the toast stays on screen, while property@Toast:priority determines how it behaves if another toast is already being displayed.
Toast titles use Pango markup by default, set property@Toast:use-markup to FALSE if this is unwanted.
property@Toast:custom-title can be used to replace the title label with a custom widget.
Actions
Toasts can have one button on them, with a label and an attached gio.action.Action.
<picture> <source srcset="toast-action-dark.png" media="(prefers-color-scheme: dark)"> <img src="toast-action.png" alt="toast-action"> </picture>
Modifying toasts
Toasts can be modified after they have been shown. For this, an adw.toast.Toast reference must be kept around while the toast is visible.
A common use case for this is using toasts as undo prompts that stack with each other, allowing to batch undo the last deleted items:
<picture> <source srcset="toast-undo-dark.png" media="(prefers-color-scheme: dark)"> <img src="toast-undo.png" alt="toast-undo"> </picture>