modal dialog confirm delete destructive warning modal dialog confirm delete destructive warning danger delete confirmation dialog destructive action modal
Modal Confirm
Fetch pattern JSON:
curl https://webspire.de/patterns/modal/confirm.json confirm.html
<div class="flex min-h-64 items-center justify-center">
<button type="button" onclick="this.nextElementSibling.hidden=false" class="rounded-lg bg-red-600 px-5 py-2.5 text-sm font-medium text-white shadow transition hover:bg-red-700">Delete Item</button>
<div class="ws-modal fixed inset-0 z-50 flex items-center justify-center bg-[var(--ws-modal-overlay)] backdrop-blur-sm" hidden>
<div role="dialog" aria-modal="true" aria-labelledby="modal-confirm-title" class="mx-4 w-full max-w-sm rounded-2xl bg-[var(--ws-modal-bg)] p-6 shadow-xl">
<div class="flex items-center gap-3">
<div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-red-100">
<svg class="h-5 w-5 text-red-600" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"/>
</svg>
</div>
<h2 id="modal-confirm-title" class="text-lg font-semibold text-[var(--ws-modal-text)]">Are you sure?</h2>
</div>
<p class="mt-3 text-sm text-[var(--ws-modal-text-soft)]">This action cannot be undone. This will permanently delete the item and all associated data.</p>
<div class="mt-6 flex justify-end gap-3">
<button type="button" onclick="this.closest('.ws-modal').hidden=true" class="rounded-lg border border-[var(--ws-modal-border)] px-4 py-2 text-sm font-medium text-[var(--ws-modal-text-soft)] transition hover:bg-white/5">Cancel</button>
<button type="button" onclick="this.closest('.ws-modal').hidden=true" class="rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-red-700">Delete</button>
</div>
</div>
</div>
</div>
Details
Responsive Dark Mode Tailwind Only SSR Safe Copy & Paste Requires JS
Stable Published
modaldialogconfirmdeletedestructivewarning
Slots
| Name | Required | Description |
|---|---|---|
| icon | No | Warning icon indicator. |
| title | Yes | Confirmation heading text. |
| body | Yes | Warning message about the destructive action. |
| actions | Yes | Cancel and delete action buttons. |
Delete confirmation modal with a warning icon, cautionary message, and a red delete button. Extends the base modal for destructive action scenarios.