How to Embed CodeSandbox Demos in Your Blog Documentation
Live code demos lift documentation engagement, but a bare iframe looks broken on mobile. Here is the embed URL format, the theme, and the pitfalls…
CodeSandbox is a cloud development environment that boots a full repository — dependencies installed, dev server running — in a browser tab or a remote VM. The free tier gives you limited VM hours per month; paid plans start at $9/month per editor with fuller machine specs.
It started in 2017 as a React playground you could paste into a blog post. That toy grew into two products: the browser sandbox (quick snippets, instant previews) and Devboxes, which are real microVMs running your actual repo with a terminal and a VS Code-flavoured editor.
Owned by Together AI since 2024. The Devbox side is the part that matters for teams — it is closer to GitHub Codespaces or Gitpod than to the old playground.
Free covers 40 VM hours a month on a 2-core machine — enough for hobby work, not a 9-to-5 job. Pro is $9/month per editor with 4 cores, 8GB RAM and 400 VM hours. Team is around $15/month per editor with shared workspaces and SSO.
Note the billing quirk. VM hours are wall-clock time the box is running, and idle timeout defaults are generous, so a forgotten tab can eat an afternoon of quota.
Good for front-end and full-stack JS/TS work, documentation demos, open-source contributors, and contractors who do not want client repos on a personal laptop.
Weak spot one: heavy native toolchains. Large C++ builds and Android emulators exceed what a 4-core VM handles comfortably. Weak spot two: offline. There is no offline mode; on a plane you are stuck.
Also worth comparing against GitHub Codespaces, which is free for 60 hours a month on 2-core machines for personal accounts and sits inside GitHub’s UI. For a GitHub-only team, Codespaces is usually the cheaper default.