Indeed a good addition to the HTML standard, and a nice article. I would also cover on the "closing the dialog" section on the option to close on click outside, which is a common UX behavior. Your cover image made me laugh... I had never had 13 people cheering me when adding a modal to my UI... 😆
Rust and backend developer exploring systems programming and AI agent infrastructure. I enjoy breaking down technical concepts through writing and contributing to open source projects.
Experienced web developer with 9 years in HTML, CSS, JavaScript, React, Node.js, Express, and Python. Currently learning GenAI, passionate about the future of web development.
That’s out of the scope of the blog post, but you can just bind an event to a button in the modal or to the form or if your using a framework, use their way of attaching events.
Indeed a good addition to the HTML standard, and a nice article. I would also cover on the "closing the dialog" section on the option to close on click outside, which is a common UX behavior. Your cover image made me laugh... I had never had 13 people cheering me when adding a modal to my UI... 😆
Glad you enjoyed the article! I always have generwting cover images now. 😆
Great post.
Thanks Lymah!
Good info!
Thanks Scott!
Cool
oh wow this is cool
Thanks Medea!
Thanks for the post; it really sums up the issue from the past and shows how the dialog element is helpful now!
Thanks!
we've gone such a long way since bootstrap's 40 lines of code modals 🤣
It is in tailwind now
Nice post Nick, but how can pass the value of the input element in you dialog back to the page?
I think I figured it out: codepen.io/cdoremus/pen/MWxrpKm
That’s out of the scope of the blog post, but you can just bind an event to a button in the modal or to the form or if your using a framework, use their way of attaching events.
in your css add
dialog::backdrop {
background: rgba(0, 0, 0,.5);
backdrop-filter: blur(0.5rem);
}
Den you get a blurred slightly darkened background
That's correct. It's an example to show how to blur out the rest of the page aside from the modal which is the focus.