DevactionUI.Alert (devaction_ui v0.2.3)

Copy Markdown View Source

A short message under a form or at the top of a screen: it worked, the AI did something, here is how it is, this failed. One line of title and a line or two of text, with an icon, in the darker text of its tone. kind: :risk is announced as an alert; the others as a status.

The boundary with DevactionUI.Callout: an alert is a notice that says one thing and has no way out; a callout is a block the reader acts on, with a title, a longer body and actions under it.

Summary

Functions

A tinted notice with a title, an optional icon and an optional body.

Functions

alert(assigns)

@spec alert(map()) :: Phoenix.LiveView.Rendered.t()

A tinted notice with a title, an optional icon and an optional body.

Attributes

  • kind (:atom) - the tone it is drawn in: a plain tone, or the canvas's name (:ai is the amber of what the AI did, :warning the red, :decision the green, :tip the blue, :note the grey). Defaults to :info. Must be one of :ok, :ai, :info, :warn, :risk, :neutral, :indigo, :emerald, :note, :tip, :warning, or :decision.
  • title (:string) (required) - the bold first line.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block - the line or two of text under the title.
  • icon - the icon, drawn by the caller.