Confirmation Dialog with BrutRB, Web Components, and no JS

August 18, 2025 📬 Get My Weekly Newsletter

I created a short (8 minute) screencast on adding a confirmation dialog to form submissions using BrutRB’s bundled Web Components. You don’t have to write any JavaScript, and you can completely control the look and feel with CSS.

There’s also a tutorial that does the same thing or, if you are super pressed for time:

<form>
  <brut-confirm-submit message="Are you sure?">
    <button>Save</button>
  </brut-confirm-submit>
</form>

<brut-confirmation-dialog>
  <dialog>
    <h1></h1>
    <button value="ok"></button>
    <button value="cancel">Nevermind</button>
  </dialog>
</brut-confirmation-dialog>

Progressive enhancement, and no magic attributes on existing elements.