Skip to main content

Module notification

Module notification 

Source
Expand description

Notification toasts — transient messages stacked in a screen corner.

Hold a Toasts in your app state, push messages onto it, and call Toasts::show once per frame. Toasts fade in, auto-dismiss after their duration (unless hovered), and can be closed manually.

// in app state: toasts: sc::Toasts,
if ui.button("Notify").clicked() {
    self.toasts.success("Saved", "Your changes were stored.");
}
self.toasts.show(ui.ctx());

Structs§

Toasts
A stack of active toasts. Cheap to keep in app state.

Enums§

ToastAnchor
Where toasts stack on screen.