Modern browsers now support building styled confirmation dialogs without JavaScript using Invoker Commands and @starting-style CSS. The `command` and `commandfor` attributes enable declarative dialog control, while `closedby="any"` provides light dismiss functionality. Combined with `@starting-style` for animations and `allow-discrete` for exit transitions, developers can create polished confirmation dialogs using only HTML and CSS. The article demonstrates integration with Turbo's confirmation system using minimal JavaScript that only sets message text and opens the dialog, while the browser handles all interaction logic including keyboard events, backdrop clicks, and button detection through the dialog's `returnValue` property.
Table of contents
Adding Animations with @starting-style #Browser Support #Integrating with Turbo’s Confirm System #Addendum: Preventing Background Scroll #Appendix: Interactive Demo #Sort: