Islands Architecture
You'll learn how Islands Architecture uses isolated interactive components ("islands") surrounded by static HTML to optimize performance and reduce JavaScript overhead.
The Core Idea
Imagine a mostly static web page—like a blog post or documentation site—with just a few interactive elements: a search bar, an image carousel, or a "like" button. Traditional SSR with full hydration would make the entire page interactive, shipping JavaScript for every component. Islands Architecture flips this: the page is mostly static HTML (the "sea"), and only specific interactive regions (the "islands") get hydrated with JavaScript.
How It Works
Instead of hydrating the whole page, you explicitly mark which components need interactivity. The framework renders static HTML for everything else and only sends JavaScript bundles for those islands. Each island hydrates independently—they're isolated from each other and from the static content around them.
This creates a hybrid approach: you get SSR's fast initial render and dramatically reduced JavaScript payloads because only interactive parts receive client-side code.
Benefits
- Smaller JS bundles: Only interactive components ship JavaScript
- Faster TTI: Less code to parse and execute means quicker interactivity
- Targeted hydration: No wasted effort hydrating static content
- Progressive enhancement: The page works without JavaScript for most content
The Trade-off
You must carefully identify which components need interactivity. Components can't easily share state across island boundaries without additional coordination.
Key Takeaway: Islands Architecture treats interactive components as isolated "islands" in a sea of static HTML, hydrating only what needs interactivity to minimize JavaScript overhead and maximize performance.