How It Works
Modals are built with HTML, CSS, and JavaScript. They sit above the document flow, use the native dialog API for focus and escape behavior, and close automatically when the backdrop is clicked.
System attributes control behavior. Tailwind classes remain free for spacing, color, animation, elevation, and any visual language you want to apply.
| Attribute | Role |
|---|---|
| data-tw-toggle="modal" | Declares that the trigger controls a modal component. |
| data-tw-target="#exampleModal" | Points to the target modal by selector-like id reference. |
| data-tw-dismiss="modal" | Closes the nearest managed modal. |
| data-tw-modal | Marks the dialog as a managed modal root. |
| data-modal-panel | Marks the visible panel inside the full-screen dialog root. |
| data-tw-position | Sets layout position: top, start, center, end, bottom. |