SigmaKit.Components.Modal (sigma_kit v0.0.1)

Summary

Functions

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

modal(assigns)

Renders a modal.

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>

Attributes

  • id (:string) (required)
  • show (:boolean) - Defaults to false.
  • title (:string) - Defaults to nil.
  • on_cancel (Phoenix.LiveView.JS) - Defaults to %Phoenix.LiveView.JS{ops: []}.
  • form (:any) - Defaults to nil.
  • as (:any) - Defaults to nil.
  • noclose (:boolean) - Defaults to false.
  • submit (:string) - Defaults to "submit".
  • change (:string) - Defaults to "validate".
  • submit_text (:string) - Defaults to "Submit".
  • target (:any) - Defaults to nil.
  • wide (:boolean) - Defaults to true.
  • error (:string) - Defaults to nil.

Slots

  • inner_block (required)
  • description
  • actions

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