ARCHITECTURE · 5 MIN · JUNE 2026
Embedding runnable demos in posts
A walkthrough of embedding a runnable code sandbox directly inside an article.

Embedding runnable demos in posts

Demo projects click when you can run them right next to the words. Instead of sending you off to GitHub, this one boots in your browser.

A live, runnable demo

Press run to boot a Node environment and the dev server, right here on the page. No install, no leaving the article.

Vite vanilla / main.js

How it works

The sandbox loads on demand, so the page stays light until a reader presses run. It then boots a real WebContainer in the browser: npm install, dev server, live preview. Use the Run in StackBlitz link to open it full screen in a new tab.