Building interactive blocks: a step-by-step workshop
summary
Demo shows a concrete Interactivity API workflow that turns server-rendered PHP blocks into reactive front-end pieces using Interactivity API, a Gutenberg branch and WP Now / WordPress Playground for zero‑setup testing. It builds quiz and search blocks with directives (data-wp-bind, data-wp-on, WP effect), serializes initial state from PHP, uses preact for diffing and preserves UI state across client navigation. Code and repo steps are available, the examples work live in the demo including instant navigation, preserved likes and client-side comment submission.
AI-written summary · about
chapters (13)
- 0:00Introduction and setup
- 6:10Interactivity API overview
- 16:18How the API works under the hood
- 34:36WordPress playground introduction
- 46:26Starting the workshop project
- 52:03Building the quiz block
- 1:02:05Making the block interactive
- 1:17:15Adding accessibility features
- 1:29:20Pre-populating state and translations
- 1:34:00Adding side effects and key handlers
- 1:38:41Scaling the interactive blocks
- 1:41:54Real-world examples and demos
- 1:48:42Future of the API and feedback
