Server Islands in Astro

From the Astro cheat sheet Β· Modern Astro (Server Islands, Actions, Sessions) Β· verified Jul 2026

Server Islands

Static page + dynamic server-rendered components streamed in

astro
---
// src/pages/product/[id].astro
import StaticInfo from '../../components/StaticInfo.astro'
import Cart from '../../components/Cart.astro'
---
<html>
  <body>
    <StaticInfo id={Astro.params.id} />

    {/* server:defer renders this on the server AFTER the static HTML ships */}
    <Cart server:defer>
      <CartFallback slot="fallback" />
    </Cart>
  </body>
</html>
πŸ’‘ Static HTML + server-streamed chunks in one response β€” no client JS to hydrate
πŸ“Œ Requires an adapter and a deployment target that supports streaming
⚑ Always provide a <slot name="fallback"> so the static shell renders cleanly
🎯 Use for cart, "recently viewed", per-user banners on cacheable marketing pages
server-islandsstreamingmodern

More Astro tasks

Back to the full Astro cheat sheet