<dialog data-ecl-auto-init="Modal" id="modal-example" data-ecl-modal-toggle="modal-toggle" class="ecl-modal">
<div class="ecl-modal__container ecl-container">
<div class="ecl-modal__content ecl-col-12 ecl-col-m-8 ecl-offset-m-2 ecl-col-l-6 ecl-offset-l-3">
<header class="ecl-modal__header">
<div class="ecl-modal__header-content">Lorem ipsum dolor sit amet</div><button
class="ecl-button ecl-button--ghost ecl-modal__close" type="button" data-ecl-modal-close=""><span
class="ecl-button__container"><span class="ecl-u-sr-only" data-ecl-label="true">Close</span><svg
class="ecl-icon ecl-icon--s ecl-button__icon ecl-button__icon--after" focusable="false" aria-hidden="true"
data-ecl-icon="">
<use xlink:href="/dist/media/icons.df9fbcbe.svg#close-filled"></use>
</svg></span></button>
</header>
<div class="ecl-modal__body">Sed quam augue, volutpat sed dapibus in, accumsan a arcu. Nulla quam enim, porttitor
at neque a, egestas porttitor tortor. Nam tortor sem, elementum id augue quis, posuere vestibulum dui. Donec id
posuere libero, sit amet egestas lorem. Aliquam finibus ipsum mauris, a molestie tortor laoreet.</div>
<footer class="ecl-modal__footer">
<div class="ecl-modal__footer-content"><button class="ecl-button ecl-button--secondary ecl-modal__button"
type="button" data-ecl-modal-close="">Secondary action</button><button
class="ecl-button ecl-button--primary ecl-modal__button" type="submit">Primary action</button></div>
</footer>
</div>
</div>
</dialog>
Try it yourself on the playground
PlaygroundNote: you can have any button in the modal act as a close button. To do so, simply add data-ecl-modal-close
to it.