LanternUI.Components.Toast (LanternUI v0.8.2)

Copy Markdown View Source

Toast notification stack. Render once in a LiveView layout and push messages with LanternUI.send_toast/4.

placement positions the stack in any corner or edge-center; toasts enter from the nearest screen edge (sliding down from the top, up from the bottom).

<.toast_group placement="bottom-center" />

Summary

Functions

toast_group(assigns)

Attributes

  • id (:string) - Stable DOM id for the toast stack hook. Defaults to "lantern-toasts".
  • placement (:string) - Corner or edge where the toast stack anchors. Defaults to "top-right". Must be one of "top-left", "top-center", "top-right", "bottom-left", "bottom-center", or "bottom-right".
  • class (:any) - Extra classes merged onto the root element. Defaults to nil.
  • Global attributes are accepted. Arbitrary HTML/phx-* attributes passed through.