wp-interactivity-api

Diagnose and validate WordPress Interactivity API directives and stores.

14|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/wpgaurav/WordPress-skills --skill wp-interactivity-api-wpgaurav
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-interactivity-api
Source: https://github.com/wpgaurav/WordPress-skills/tree/main/skills/wordpress/wp-interactivity-api
Command: npx skills add https://github.com/wpgaurav/WordPress-skills --skill wp-interactivity-api-wpgaurav

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

WordPress Interactivity API development and debugging often requires understanding directives, stores, and hydration to ensure correct interactive behavior across blocks, themes, and plugins.

Core Features & Use Cases

  • Diagnose and validate data-wp-interactive, data-wp-on--, and data-wp-bind-- directives across frontend and editor surfaces.
  • Identify stores, state shape, actions, and event handlers used by @wordpress/interactivity to drive consistent user interactions.
  • Guide server-side rendering and hydration strategies to ensure initial HTML mirrors client-side state and reduces layout shifts.
  • Provide practical steps for integrating directives within block.json and non-block contexts.

Quick Start

Describe your interactivity issue and share the related WP surface (block, theme, or plugin) plus any triage data to begin debugging.

Frequently Asked Questions about wp-interactivity-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug WordPress Interactivity API directives like data-wp-interactive?

To debug WordPress Interactivity API directives, you must diagnose how data-wp-interactive, data-wp-on--*, and data-wp-bind--* are applied across frontend and editor surfaces to ensure proper hydration and consistent interactions.

How does state initialization work with @wordpress/interactivity stores?

State initialization in @wordpress/interactivity stores works by identifying the state shape, actions, and event handlers to drive user interactions, ensuring the initial server-side rendered HTML mirrors client-side state to reduce layout shifts.

What is the best way to integrate Interactivity API directives within block.json?

The best way to integrate Interactivity API directives within block.json is by configuring the block viewScriptModule and applying safe integration guidelines to ensure proper directive processing and hydration within block contexts.

Can I use WordPress Interactivity API directives in non-block contexts like themes and plugins?

Yes, you can use WordPress Interactivity API directives in non-block contexts like themes and plugins by following practical integration steps that ensure correct directive processing and state hydration across frontend and editor surfaces.

Why does my WordPress block layout shift after hydration?

Layout shifts occur after hydration when server-side rendering does not correctly mirror the initial client-side state, requiring you to validate your server-side rendering and hydration strategies to align the HTML output.