# Alert Dialog A modal dialog that interrupts the user with important content and expects a response. Show Dialog Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. ## Usage Alert Dialog uses a native `` element. Omit the close button and backdrop-click handler when the user must choose an explicit action. ```html Show Dialog Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. ``` ### HTML structure <button type="button" onclick="dialog.showModal()"> Optional Trigger button. Basecoat uses the native HTMLDialogElement.showModal() method. <dialog class="alert-dialog" id="{ DIALOG_ID }"> Native modal dialog. Add aria-labelledby and aria-describedby when title and description are present. <div> Dialog content surface. <header> Alert dialog header. <figure> Optional Media area for an icon or image. <h2 id="{ TITLE_ID }"> Alert dialog title. Reference it from aria-labelledby. <p id="{ DESCRIPTION_ID }"> Optional Alert dialog description. Reference it from aria-describedby. <footer> Action area. Include a cancel action and the primary action. ## Examples ### Basic A basic alert dialog with a title, description, and cancel and continue buttons. Show Dialog Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. ### Media Use a `` in the header to add a media element such as an icon or image to the alert dialog. Share Project Share this project? Anyone with the link will be able to view and edit this project. ### Destructive Use a destructive action button when the alert dialog confirms a destructive operation. Delete Chat Delete this chat? This action cannot be undone. This will permanently delete the chat and remove it from your history. ### RTL Alert Dialog supports document direction. Set `dir="rtl"` on the dialog or a parent element. إظهار الحوار هل أنت متأكد تماماً؟ لا يمكن التراجع عن هذا الإجراء. سيتم حذف حسابك نهائياً وإزالة بياناتك من خوادمنا.
This action cannot be undone. This will permanently delete your account and remove your data from our servers.
<button type="button" onclick="dialog.showModal()">
HTMLDialogElement.showModal()
<dialog class="alert-dialog" id="{ DIALOG_ID }">
aria-labelledby
aria-describedby
<div>
<header>
<figure>
<h2 id="{ TITLE_ID }">
<p id="{ DESCRIPTION_ID }">
<footer>
Anyone with the link will be able to view and edit this project.
This action cannot be undone. This will permanently delete the chat and remove it from your history.
لا يمكن التراجع عن هذا الإجراء. سيتم حذف حسابك نهائياً وإزالة بياناتك من خوادمنا.