Client Islands: Interactive Boundaries in the Tree
You'll learn: How 'use client' creates isolated islands of interactivity within an otherwise server-rendered component tree, ensuring JavaScript is shipped only where user interaction is needed.
The Island Architecture Mental Model
Think of your React app as an archipelago. The ocean is your server-rendered HTML—static, fast, and requiring zero JavaScript. The islands are your interactive components—buttons, forms, carousels—that need event handlers and state.
When you place 'use client' at the top of a module, you're drawing a boundary around an island. Everything within that boundary ships JavaScript to the browser. Everything outside remains pure server-rendered HTML.
How Islands Form in the Tree
The default server component tree flows downward:
<Page> (server)
└─ <Article> (server)
├─ <Metadata> (server)
└─ <LikeButton> (client island! 'use client')
The <LikeButton> creates an interactive boundary. React sends its JavaScript bundle to the browser. The rest? Just HTML.
Multiple islands can exist independently:
<Dashboard> (server)
├─ <Chart> (client island)
├─ <StaticReport> (server)
└─ <CommentSection> (client island)
Each 'use client' boundary is a separate island with its own bundle.
The Selective Hydration Advantage
The browser only downloads and hydrates the JavaScript needed for interactive islands. A mostly-static blog post with one interactive widget? You ship kilobytes, not megabytes.
This is fundamentally different from traditional React apps where the entire tree requires JavaScript, even for purely static content.
Key Takeaway: Client islands are strategic boundaries in your component tree where interactivity begins—React ships JavaScript only for these islands, keeping the rest as lightweight server-rendered HTML, dramatically reducing bundle sizes while preserving full interactivity where needed.