View Source LightningWeb.Components.Modal (Lightning v2.10.4)

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

Attributes

  • id (:string) (required)
  • show (:boolean) - Defaults to false.
  • with_frame (:boolean) - Defaults to true.
  • target (:any) - Defaults to nil.
  • 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)

Attributes

  • class (:any) - Defaults to "".

Slots

  • inner_block (required)

Functions

Link to this function

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

View Source

Attributes

  • id (:string) (required)
  • show (:boolean) - Defaults to false.
  • with_frame (:boolean) - Defaults to true.
  • target (:any) - Defaults to nil.
  • 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)
Link to this function

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

View Source