PureAdmin.Components.Popconfirm (PureAdmin v1.1.0)

Copy Markdown View Source

Popconfirm component for Pure Admin.

Small confirmation dialogs anchored to trigger buttons. Perfect for delete confirmations and quick yes/no decisions. Uses Floating UI for positioning with automatic collision detection.

Summary

Functions

Renders a popconfirm with a trigger button and confirmation dialog.

Functions

popconfirm(assigns)

Renders a popconfirm with a trigger button and confirmation dialog.

Examples

<.popconfirm
  id="delete-item"
  message="Are you sure you want to delete this item?"
  confirm_event="delete"
  confirm_value={%{id: @item.id}}
>
  <.button variant="danger" size="xs">Delete</.button>
</.popconfirm>

<.popconfirm
  id="archive"
  message="Archive this item?"
  icon_variant="warning"
  confirm_text="Archive"
  confirm_variant="warning"
  confirm_event="archive"
>
  <.button variant="warning">Archive</.button>
</.popconfirm>

Attributes

  • id (:string) (required)
  • message (:string) (required) - Confirmation message text.
  • placement (:string) - Defaults to "bottom". Must be one of "top", "bottom", "start", or "end".
  • icon_variant (:string) - Icon style for the message. Defaults to nil. Must be one of nil, "danger", "warning", or "info".
  • is_compact (:boolean) - Compact variant for table actions. Defaults to false.
  • confirm_text (:string) - Confirm button text (default: translated). Defaults to nil.
  • cancel_text (:string) - Cancel button text (default: translated). Defaults to nil.
  • confirm_variant (:string) - Confirm button color variant. Defaults to "danger". Must be one of "primary", "secondary", "success", "warning", "danger", or "info".
  • confirm_event (:string) - LiveView event to push on confirm. Defaults to nil.
  • confirm_value (:map) - Value to send with confirm event. Defaults to %{}.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required) - Trigger content (usually a button).