1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00
Files
tabler/docs/content/ui/components/modals.md
2025-04-15 23:18:49 +02:00

9.9 KiB
Raw Blame History

title, summary, description
title summary description
Modals Use Bootstraps JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content. Dialogs for notifications and content.

Modals are built with HTML, CSS, and JavaScript. Theyre positioned over everything else in the document and remove scroll from the <body> so that modal content scrolls instead.

Default markup

To create a modal, you need to add a .modal element to the document. Inside the .modal, you need to add a .modal-dialog element, which contains a .modal-content element. The .modal-content element contains the modals header, body, and footer.

<div class="modal" tabindex="-1">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">...</div>
      <div class="modal-body">...</div>
      <div class="modal-footer">...</div>
    </div>
  </div>
</div>

Look at the example below to see how the modal looks.

{% capture html -%} Launch demo modal

Modal title
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci animi beatae delectus deleniti dolorem eveniet facere fuga iste nemo nesciunt nihil odio perspiciatis, quia quis reprehenderit sit tempora totam unde.
Close Save changes
{%- endcapture %} {% include "docs/example.html" html=html centered bg="surface-secondary" %}

Prompt and alert

You can use the modal to create a prompt or alert. Look at the example below to see how the prompt and alert look.

{% capture html -%}

Are you sure?

Do you really want to remove 84 files? What you've done cannot be undone.
{%- endcapture %} {% include "docs/example.html" html=html raw bg="surface-secondary" %}

{% capture html -%}

Payment succeeded

Your payment of $290 has been successfully submitted. Your invoice has been sent to support@tabler.io.
{%- endcapture %} {% include "docs/example.html" html=html raw bg="surface-secondary" %}

Modal with form

You can use the modal to create a form. Look at the example below to see how the form looks.

{% capture html -%}

New report
Name
Report type
Simple Provide only basic data needed for the report
Advanced Insert charts and additional advanced analyses to be inserted in the report
Visibility Private Public Hidden
Client name
Reporting period
Additional information
{%- endcapture %} {% include "docs/example.html" html=html raw bg="surface-secondary" class="px-5" %}