+++ title = "Modal Dialogs with UIKit" template = "demo.html" +++ Many CSS toolkits include styles (and Javascript) for creating modal dialog boxes. This example shows how to use HTMX to display dynamic dialog using UIKit, and how to trigger its animation styles with little or no Javascript. We start with a button that triggers the dialog, along with a DIV at the bottom of your markup where the dialog will be loaded: This is an example of using HTMX to remotely load modal dialogs using UIKit. In this example we will use [Hyperscript](https://hyperscript.org) to demonstrate how cleanly that scripting language allows you to glue htmx and other libraries together. ```html
``` This button uses a `GET` request to `/uikit-modal.html` when this button is clicked. The contents of this file will be added to the DOM underneath the `#modals-here` DIV. Rather than using the standard UIKit Javascript library we are using a bit of Hyperscript, which triggers UIKit's smooth animations. It is delayed by 10ms so that UIKit's animations will run correctly. Finally, the server responds with a slightly modified version of UIKit's standard modal ```htmlThis modal dialog was loaded dynamically by HTMX.