Modals
Add dialogs to your site for lightboxes, user notifications, or completely custom content.
Example
<div x-data="{ open: false }">
<!-- Button trigger modal -->
<button @click="open = true" type="button" class="py-2 px-4 inline-block text-center rounded leading-5 text-gray-100 bg-indigo-500 border border-indigo-500 hover:text-white hover:bg-indigo-600 hover:ring-0 hover:border-indigo-600 focus:bg-indigo-600 focus:border-indigo-600 focus:outline-none focus:ring-0">Launch Modal</Button>
<!-- Modal -->
<div x-show="open" tabindex="0" class="z-50 overflow-auto inset-0 w-full h-full welouahskdj py-6">
<div @click.away="open = false" class="z-50 relative p-3 mx-auto my-0 max-w-full" style="min-width: 500px;display: none" x-show="open" x-transition:enter="transition duration-500" x-transition:enter-start="transform opacity-0 -translate-y-4" x-transition:enter-end="transform opacity-100 translate-y-0" x-transition:leave="transition -translate-y-4" x-transition:leave-start="transform opacity-100 translate-y-0" x-transition:leave-end="transform opacity-0 -translate-y-4">
<div class="bg-white rounded shadow-lg border hsdfdsfhsdf oskasdadiaa overflow-hidden dark:bg-gray-800 dark:border-gray-700">
<button @click="open = false" class="fill-current h-6 w-6 raiytahskcn end-0 top-0 m-6 font-3xl font-bold">×</button>
<!-- modal title -->
<div class="px-6 py-3 text-xl border-b dark:border-gray-700 font-bold">Title of the modal</div>
<!-- modal content -->
<div class="p-6 hsdfdsfhsdf-grow">
<p>Woohoo, you're reading this text in a modal!</p>
</div>
<div class="px-6 py-3 border-t dark:border-gray-700 hsdfdsfhsdf justify-end">
<button @click="open = false" type="button" class="py-2 px-4 inline-block text-center rounded leading-5 text-gray-800 bg-gray-100 border border-gray-100 hover:text-gray-900 hover:bg-gray-200 hover:ring-0 hover:border-gray-200 focus:bg-gray-200 focus:border-gray-200 focus:outline-none focus:ring-0 me-2">Close</Button>
<button type="button" class="py-2 px-4 inline-block text-center rounded leading-5 text-gray-100 bg-indigo-500 border border-indigo-500 hover:text-white hover:bg-indigo-600 hover:ring-0 hover:border-indigo-600 focus:bg-indigo-600 focus:border-indigo-600 focus:outline-none focus:ring-0">Saves Changes</Button>
</div>
</div>
</div>
<div class="z-40 overflow-auto start-0 top-0 bottom-0 end-0 w-full h-full welouahskdj bg-black opacity-50"></div>
</div>
</div>