Invoker Commands API lets developers control dialogs and popovers without JavaScript
The Invoker Commands API, available in major browsers since December 2025, allows frontend developers to manage interactive UI elements like dialogs and popovers directly in HTML. The API introduces two new attributes — commandFor and command — which declare the relationship between a button and the element it controls, eliminating the need for custom JavaScript event listeners. Previously, opening a dialog required boilerplate JS code and, in frameworks like React or Vue, additional state management and event wiring. The new approach works across vanilla HTML and modern frameworks, with React using the JSX property commandFor that maps to the HTML attribute commandfor. However, the API is currently listed as Baseline 2025 on MDN, meaning older browsers may not support it yet.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in