DevactionUI.Callout (devaction_ui v0.2.3)

Copy Markdown View Source

A tinted block that says something to the reader: a note, what the AI did, a tip, a warning, a decision. Color is never alone: it always carries a title or an icon slot, and an :alert role when it is urgent.

kind is the canvas's name (:note, :ai, :tip, :warning, :decision) or a plain tone (:risk, :warn, :ok, :info, :neutral). With title, the title is bold on its own line; actions is a row for buttons under the body. The role follows the kind: alert for :risk, :warn and :warning, status for the rest; role overrides it.

icon_layout: :inline (the canvas's) draws the icon, 16 px, on the line of the title, or beside the body when there is no title; :box puts it in a 32 px tile at the left of everything. compact is the tight one for a note inside a card or a form: less padding, a 13 px text.

The boundary with DevactionUI.Alert: a callout is a block the reader acts on, with a longer body and actions; an alert is the one-line notice with no way out.

Summary

Functions

A tinted block with an optional title, icon and actions.

Functions

callout(assigns)

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

A tinted block with an optional title, icon and actions.

Attributes

  • kind (:atom) - the canvas's name for what it says, or a plain tone. Defaults to :note. Must be one of :note, :ai, :tip, :warning, :decision, :risk, :warn, :ok, :info, :neutral, :indigo, :emerald, :chart_1, :chart_2, :chart_3, or :chart_4.
  • title (:string) - the bold first line. Defaults to nil.
  • icon_layout (:atom) - :inline the icon on the line of the title, :box a tile at the left of the body. Defaults to :inline. Must be one of :inline, or :box.
  • compact (:boolean) - less padding and a 13 px text. Defaults to false.
  • role (:string) - overrides the role the kind gives: alert for something urgent, status for a change. Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)
  • icon - the icon, drawn by the caller in the tone of the callout.
  • actions