Develop With Faith
July 20, 2026

JavaScript-Free Modals for Church Websites: The Invoker Commands API

If your church website has a "Give" modal, an event RSVP dialog, or a popover that reveals service times, there is a good chance a JavaScript library is doing the opening and closing. That library ships to every visitor, runs on every tap, and quietly slows down the exact moment you want to feel snappy. In January of this year, that job became something the browser can do on its own.

The change is called the Invoker Commands API, and as of the Safari 26.2 release it has full support in Chrome, Firefox, Edge, and Safari — the Baseline milestone that means it is safe to ship without a fallback.

Two new attributes do the work: command and commandfor. A button declares what to open and what action to perform, and the browser handles the rest.

<button commandfor="give-dialog" command="show-modal">Give</button>

<dialog id="give-dialog">
  <p>Thank you for supporting the ministry.</p>
  <button commandfor="give-dialog" command="close">Close</button>
</dialog>

No event listeners. No preventDefault. No focus-trap library. The <dialog> element opens as a proper modal, traps focus, closes on Escape, and returns focus to the invoking button when it closes — accessibility that used to take a hundred lines to get right.

For a small church, this trims three practical things at once. The JavaScript bundle gets smaller, which helps mobile visitors on a shaky cell signal in the parking lot. The Time to Interactive score on your Lighthouse report improves, which quietly helps search rankings. And the risk that a script error somewhere else on the page breaks your donation button drops close to zero — because the button no longer depends on a script.

The same pattern works for popovers (command="toggle-popover" on a menu button and popover on the target), for confirmation dialogs on your admin volunteer forms, and for any "learn more" reveal on a plan-your-visit page.

If your church site is due for a refresh and still ships a jQuery modal from 2018, this is a good excuse to modernize a small corner of it. We would be glad to help.

← Back to all posts