Raxol.UI.Components.Harness.Toast (Raxol v2.6.1)

View Source

Transient notification: a small floating notice with a level-appropriate glyph and color. The glyph carries the meaning too (not color alone), so the toast stays legible for colorblind users and on no-color terminals.

This component renders the notice itself; corner placement and auto-dismiss timing are the caller's job -- compose with Raxol.UI.Components.AbsoluteLayer.overlay/3 (e.g. overlay(:right, :bottom, toast_view)) the same way Raxol.UI.Components.Modal.Rendering's dialog surface is positioned by its caller rather than positioning itself.

Summary

Types

level()

@type level() :: :info | :warn | :error

t()

@type t() :: %{
  id: String.t() | atom(),
  message: String.t(),
  level: level(),
  ttl_ms: non_neg_integer(),
  style: map(),
  theme: map()
}

Functions

broadcast(msg)

command(cmd)

handle_event(event, state, context)

Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.

mount(state)

Callback implementation for Raxol.UI.Components.Base.Component.mount/1.

schedule(msg, delay)

unmount(state)

Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.

update(props, state)

Callback implementation for Raxol.UI.Components.Base.Component.update/2.