Skip to content
All components

Components

Toast

Push a toast from anywhere with the context and draw the stack once per frame with Toasts::show; the newest sits lowest. Each carries a tone dot and one line of words, slides in from the right, waits while the pointer is over it, then fades out. An error that needs a way out belongs on the page as well. The web face does not draw it yet.

No web face yet

Today the Mac draws it through ocean-ui-native; the web face does not draw it yet.

On the Mac

The same vocabulary drawn by Ocean UI's native face (egui on Metal), as the gallery's snapshot.

Toast drawn by Ocean UI's native face, darkToast drawn by Ocean UI's native face, light

Use it

Native

use ocean_ui_native::widgets::{Toast, Toasts};
Toasts::push(ui.ctx(), Toast::new(Tone::Ok, "Copied the link"));

Cargo feature base of ocean-ui-native; available since 2026-10-29.

Props

NameTypeDefaultWhat
toneTone—The dot's colour: Neutral, Ok, Warn, Bad, Info or Brand.
textString—One line of words, in sentence case.

Accessibility

  • The words are a text label in the foreground layer, so assistive technology can read them while the toast is up.
  • No live region is set, so a screen reader is not told when a toast arrives; keep anything that matters on the page too.
  • The tone is a dot beside the words, never colour alone, and under reduced motion the toast appears and leaves at once.

Related

Markdown

The same page as Markdown, for an agent or a pull request.

Search

esc

Components

Blocks

Screens built from blocks

The Ocean app

Ocean Base console