LightningWeb.Components.Modal (Lightning v2.13.3)

View Source

A modal component that can be used to display a modal on the page.

This currently isn't used anywhere but should be used in the future to replace the existing modal implementations.

Summary

Functions

hide_modal(js \\ %JS{}, id)

modal(assigns)

Attributes

  • id (:string) (required)
  • show (:boolean) - Defaults to false.
  • with_frame (:boolean) - Defaults to true.
  • position (:string) - Defaults to "fixed inset-0".
  • width (:string) - Defaults to "max-w-3xl".
  • close_on_click_away (:boolean) - Defaults to true.
  • close_on_keydown (:boolean) - Defaults to true.
  • on_close (Phoenix.LiveView.JS) - Defaults to %Phoenix.LiveView.JS{ops: []}.
  • on_open (Phoenix.LiveView.JS) - Defaults to %Phoenix.LiveView.JS{ops: []}.
  • Global attributes are accepted.

Slots

  • inner_block (required)
  • title
  • subtitle
  • footer - Accepts attributes:
    • class (:string)

show_modal(js \\ %JS{}, id)