WordPress Interactivity API in Practice: Reactive UI Without Shipping Heavy React Bundles
1. Declarative Reactivity Built Directly Into WordPress Core
Until recently, building reactive toggles, live filter bars, or multi-step modals inside WordPress blocks meant bundling heavy React runtime code on the front end—or writing ad-hoc vanilla DOM listeners that quickly turned into spaghetti code. Introduced in WordPress 6.5 and expanded through 2026, the Interactivity API gives theme and block authors a tiny (~10KB) reactive runtime inspired by Preact signals.
Using declarative HTML attributes like data-wp-interactive, data-wp-on--click, and data-wp-bind--aria-expanded, server-rendered PHP markup hydrates cleanly with zero layout shift.

<div data-wp-interactive="kiln/filter">
<button data-wp-on--click="actions.selectNiche" data-wp-bind--aria-pressed="state.isSelected">
Architecture
</button>
</div>
2. Interactivity API vs. Vanilla JS Modules
If you are building custom Gutenberg blocks that need shared state across multiple block instances on the same page (like a product wishlist counter synced across cards and header), the Interactivity API is the cleanest native choice. For single-purpose canvas effects like Three.js shaders, a scoped ES module script remains even leaner.
FAQ — Does the Interactivity API hurt INP? Quite the opposite: its micro-runtime avoids full virtual-DOM diffing overhead and keeps interaction callbacks crisp.