Modal

Renders a modal.

Read more Read less

Examples

<.modal id="confirm-modal">
  This is a modal.
</.modal>

JS commands may be passed to the :on_cancel to configure the closing/cancel event, for example:

<.modal id="confirm" on_cancel={JS.navigate(~p"/posts")}>
  This is another modal.
</.modal>
Attribute Type Documentation Default Value
Required id * :string
show :boolean false
on_cancel %JS{} %Phoenix.LiveView.JS{ops: []}
Required inner_block * :slot
Modal body
<.dialog_footer>
    <.button type="submit">Cancel</.button>
</.dialog_footer>