(ui_components)= # UI components This document provides a reference for Wagtail's user interface (UI) components, which are used to build the features within the CMS. A demonstration of these components are available through the [Styleguide app](styleguide) and the [pattern library](pattern_library). ````{note} ```{include} ../../../client/README.md :start-after: :end-before: ``` ```` ## Fragment ```{eval-rst} .. autofunction:: wagtail.admin.templatetags.wagtailadmin_tags.fragment ``` ## Dialog ```{eval-rst} .. class:: wagtail.admin.templatetags.wagtailadmin_tags.DialogNode :no-contents-entry: ``` A dialog to display information in a modal dialog. It is powered by the [`DialogController`](controller:DialogController) (`w-dialog`). To create a dialog, you can use the `{% dialog %}` and `{% enddialog %}` template tags. ```html+django {% dialog icon_name="globe" title="Dialog with critical error" id="my-dialog" subtitle="This is a testing subtitle" message_status="critical" message_heading="There was an issue with the thing" message_description="This is a subtext for the message" %}
This dialog message was generated by passing message_status=critical as well as message_heading and message_description to the dialog template tag
{% enddialog %} ``` Required arguments for the `{% dialog %}` tag: - `id`: The ID of the dialog, to be used by the [`{% dialog_toggle %}`](dialog_toggle) tag. - `title`: The title of the dialog. Optional arguments for the `{% dialog %}` tag: - `dialog_root_selector`: The CSS selector for the dialog root element, defaults to `body`. Useful when you want to render the dialog in a specific part of the DOM, such as within a `