Confirmation Dialog
Delete/action confirmation modal
Preview
Delete Item
Are you sure? This action cannot be undone.
{ window.Prism.highlightElement($refs.codeEl) }) }"
class="w-full flex items-center justify-between px-6 py-4 text-left bg-gray-50 dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer">
View Code
<div x-data="{ open: false }">
<button @click="open = true" class="px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700">Delete Item</button>
<div x-show="open" class="fixed inset-0 z-50 overflow-y-auto" x-cloak>
<div class="flex items-center justify-center min-h-screen px-4">
<div @click="open = false" class="fixed inset-0 bg-black opacity-50"></div>
<div class="relative bg-white dark:bg-gray-800 rounded-lg max-w-md w-full p-6">
<h3 class="text-lg font-medium text-gray-900 dark:text-white">Delete Item</h3>
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">Are you sure? This action cannot be undone.</p>
<div class="flex justify-end space-x-2 mt-6">
<button @click="open = false" class="px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded">Cancel</button>
<button @click="open = false" class="px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700">Delete</button>
</div>
</div>
</div>
</div>
</div>