Purpose:
Defines a modal or dialog box.

Use Cases:

  • Login or confirmation dialogs.
  • Alerts or popups.

Accessibility:

  • Automatically announces the modal to assistive tech.
  • Must include appropriate aria-modal="true" or use showModal() for native behaviour.
<dialog id="myDialog">  
  <p>Confirm your booking?</p>  
  <button onclick="this.parentElement.close()">Cancel</button>  
</dialog>