Wasn’t it great — nay, amazing – the day we got a native HTML <dialog> element? It’s, what now, nearly ten years old? Even so, I always find myself looking up how it works, when to use it, ideas for styling it, and whatnot. There’s a lot of nuance to this seemingly little piece of web architecture and it’s high time I give it a proper look… for future Geoff, but maybe future you as well.

Marking up a <dialog>

This is the basic markup:

<button id="dialog-button">Open Dialog</button>

<dialog id="dialog">...</dialog>