Omni.UI.Notification (Omni UI v0.1.0)

Copy Markdown View Source

A single notification shown in the Omni.UI toaster.

Built via Omni.UI.notify/2 or Omni.UI.notify/3. The id is generated on construction and used by the stream + FIFO-cap bookkeeping.

Summary

Types

Notification severity.

t()

A notification struct with id, level, message, and auto-dismiss timeout.

Types

level()

@type level() :: :info | :success | :warning | :error

Notification severity.

t()

@type t() :: %Omni.UI.Notification{
  id: integer(),
  level: level(),
  message: String.t(),
  timeout: non_neg_integer()
}

A notification struct with id, level, message, and auto-dismiss timeout.

Functions

new(level, message, opts \\ [])

@spec new(level(), String.t(), keyword()) :: t()

Builds a notification.

Options

  • :timeout — ms until auto-dismiss (default 20000).