BaselineLab

HTML dialog playground

Explore dialog with a minimal preview made only from the opening button and the modal. Change command, commandfor, and closedby without generating CSS.

HTML
<button type="button" commandfor="baseline-dialog" command="show-modal">
  Abrir modal
</button>

<dialog id="baseline-dialog" closedby="any">
  <h2>Dialog nativo</h2>
  <p>Este modal usa dialog, command, commandfor y closedby sin añadir CSS.</p>
  <button type="button" commandfor="baseline-dialog" command="close">
    Cerrar
  </button>
</dialog>
JS