Hydrate only interactive UI islands, leaving static content as HTML
When to Use
Content-heavy pages where most HTML is static but a few widgets need interactivity
Performance-critical pages where full React hydration is too expensive
Using Astro, Fresh, or Next.js with 'use client' directives
You want Time to Interactive (TTI) improvements by deferring non-essential JS
Instructions
Identify which page regions are interactive (search bar, shopping cart, comments) vs static (header, article body).
Mark interactive regions as client-side islands using your framework's mechanism:
Astro:client:load, client:idle, client:visible on components
Next.js App Router:'use client' at the top of the component file
Keep islands as small as possible — each island is an independent React root.
Static content between islands is plain HTML — no React overhead.
Use client:visible (Astro) or lazy hydration for below-fold islands.
// Astro example: only the interactive widget is hydrated
---
import StaticHeader from './StaticHeader.astro'; // no JS
import InteractiveSearch from './InteractiveSearch'; // React island
---
<StaticHeader />
<InteractiveSearch client:load />
<article>...static content...</article>
Details
The islands pattern was popularized by Jason Miller (Preact creator) and Ethan Marcotte. The core insight: most web pages are "mostly static" — only specific regions need event handlers and state. Hydrating the entire page as a React app is wasteful.
Trade-offs:
Islands cannot share React state directly — use URL parameters, localStorage, or a micro-frontend event bus for cross-island communication
More complex architecture than a simple SPA
Best suited for content-driven sites (docs, marketing, e-commerce) not dashboards
React Server Components (RSC) vs islands:
RSC is React's first-party answer to the same problem in Next.js / frameworks
The conceptual model is the same (server = static, client = interactive)
RSC allows data co-location without the multi-root complexity
Read the instructions and examples in this document.
Apply the patterns to your implementation, adapting to your specific context.
Verify your implementation against the details and edge cases listed above.
Harness Integration
Type: knowledge — this skill is a reference document, not a procedural workflow.
No tools or state — consumed as context by other skills and agents.
Success Criteria
The patterns described in this document are applied correctly in the implementation.
Edge cases and anti-patterns listed in this document are avoided.
1---2name: react-islands-pattern3description: React Islands Pattern4---5# React Islands Pattern67> Hydrate only interactive UI islands, leaving static content as HTML89## When to Use1011- Content-heavy pages where most HTML is static but a few widgets need interactivity12- Performance-critical pages where full React hydration is too expensive13- Using Astro, Fresh, or Next.js with `'use client'` directives14- You want Time to Interactive (TTI) improvements by deferring non-essential JS1516## Instructions17181. Identify which page regions are interactive (search bar, shopping cart, comments) vs static (header, article body).192. Mark interactive regions as client-side islands using your framework's mechanism:20 - **Astro:** `client:load`, `client:idle`, `client:visible` on components21 - **Next.js App Router:** `'use client'` at the top of the component file223. Keep islands as small as possible — each island is an independent React root.234. Static content between islands is plain HTML — no React overhead.245. Use `client:visible` (Astro) or lazy hydration for below-fold islands.2526```tsx27// Astro example: only the interactive widget is hydrated28---29import StaticHeader from './StaticHeader.astro'; // no JS30import InteractiveSearch from './InteractiveSearch'; // React island31---32<StaticHeader />33<InteractiveSearch client:load />34<article>...static content...</article>35```3637## Details3839The islands pattern was popularized by Jason Miller (Preact creator) and Ethan Marcotte. The core insight: most web pages are "mostly static" — only specific regions need event handlers and state. Hydrating the entire page as a React app is wasteful.4041**Trade-offs:**4243- Islands cannot share React state directly — use URL parameters, localStorage, or a micro-frontend event bus for cross-island communication44- More complex architecture than a simple SPA45- Best suited for content-driven sites (docs, marketing, e-commerce) not dashboards4647**React Server Components (RSC) vs islands:**4849- RSC is React's first-party answer to the same problem in Next.js / frameworks50- The conceptual model is the same (server = static, client = interactive)51- RSC allows data co-location without the multi-root complexity5253## Source5455https://patterns.dev/react/islands-architecture5657## Process58591. Read the instructions and examples in this document.602. Apply the patterns to your implementation, adapting to your specific context.613. Verify your implementation against the details and edge cases listed above.6263## Harness Integration6465- **Type:** knowledge — this skill is a reference document, not a procedural workflow.66- **No tools or state** — consumed as context by other skills and agents.6768## Success Criteria6970- The patterns described in this document are applied correctly in the implementation.71- Edge cases and anti-patterns listed in this document are avoided.
Run npx skillmds@latest add intense-visions/react-islands-pattern in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
React Islands Pattern It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Intense-Visions (@intense-visions) published this skill. Their other Agent Skills are listed on their SkillMD profile.