Dev.Lib
arrow_backBack to Blogs
LEVEL_077.1June 27, 20261 min read

Islands architecture

Web Platform APIs

Static HTML shell with small hydrated interactive islands — minimal JS vs full SPA.

Summary

Static HTML shell with small hydrated interactive islands — minimal JS vs full SPA. Astro popularized; Next.js can approximate with selective client components. Wrong granularity: island per button vs one island per page — balance hydration cost and isolation.

Code example

<article>
  <h1>Static headline</h1>
  <p>Most content ships as HTML only.</p>
  <div id="cart-widget" data-island="cart"></div>
</article>
<script type="module">hydrateIsland('#cart-widget');</script>

Key points

  • Static HTML shell with small hydrated interactive islands — minimal JS vs full SPA.
  • Astro popularized; Next.js can approximate with selective client components.
  • Wrong granularity: island per button vs one island per page — balance hydration cost and isolation.

Further reading

Related concepts