Skip to content

Toast ​

A fixed top-center transient notice — success, error or info — that fades in and out.

Examples ​

Variants ​

moonbit
@sumi.toast(
  message="Export started — 3 files queued",
  open=show_success,
  variant=@sumi.Success,
  on_close=set_state(_ => ""),
)

API ​

toast ​

NameTypeDefaultDescription
message *String—Notice text
open *Bool—Whether the overlay is open (controlled)
variantToastVariantInfoStatus styling
on_closeCmd—Called when the toast dismisses
idString—Element id
classString—Extra class names
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

ToastVariant ​

VariantDescription
InfoNeutral glyph
SuccessBrand circle with a check
ErrorError-red glyph

* required (labelled) parameter — everything else is optional.