modal

Creates a modal dialog.

It accepts conent of the central part of modal as a first argument, which can be either text or DOM node. The second parameter is an object with options.

The object produced by the function has methods show and close that change visibility of the modal. Initially modal is hidden, and you need to call its show method to display the modal

{%- call ui.util.call(show_example) -%} {%- raw %} {%- set id = ui.util.id() -%}
{%- endraw %} {%- endcall %}

To add title and buttons in the footer to the modal, use its options title and actions.

{%- call ui.util.call(show_example) %} {%- raw %} {% set id = ui.util.id() -%}
{%- endraw %} {%- endcall %}

Other options available for modal:

{%- call ui.util.call(show_example) %} {%- raw %} {% set id = ui.util.id() -%}
{%- endraw %} {%- endcall %}

To access existing modal, rendered with ui.modal macro, use getModal method available in the JS. This method accepts ID of the modal element.

{%- call ui.util.call(show_example) -%} {%- raw %} {% set id = ui.util.id() -%}
{%- set modal_id = ui.util.id() -%} {{ ui.modal("Content", title="Title", dismissible=true, id=modal_id) }} {%- endraw %} {%- endcall %}