Modal

Attribute Type Documentation Default Value
Required id * :string
class :string
open :boolean false
show :boolean

Behaves like open attribute. This attribute exist to avoid compatibility issues with phoenix core components

closeable :boolean true
close_on_click_away :boolean false
rest :global
on_cancel %JS{} %Phoenix.LiveView.JS{ops: []}
modal_box :slot

the slot for compacting the modal body

Show slot attributes Hide slot attributes
class :string
content_class :string
<:modal_box>
  <h3 class="text-lg font-bold">Hello!</h3>
  <p class="py-4">Press ESC key or click the button below to close</p>
</:modal_box>
inner_block :slot
<form method="dialog" class="modal-backdrop">
  <button>close</button>
</form>