Skip to content
Back to skills

React Islands Pattern

ASecurity

> Hydrate only interactive UI islands, leaving static content as HTML

  • 20 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
developmentreactnextjsfrontendperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add Intense-Visions/harness-engineering --skill react-islands-pattern --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Islands Pattern?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for React Islands Pattern
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/intense-visions-react-islands-pattern/badge)](https://www.skillsdirectory.com/skills/intense-visions-react-islands-pattern)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# React Islands Pattern

> 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

1. Identify which page regions are interactive (search bar, shopping cart, comments) vs static (header, article body).
2. 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
3. Keep islands as small as possible — each island is an independent React root.
4. Static content between islands is plain HTML — no React overhead.
5. Use `client:visible` (Astro) or lazy hydration for below-fold islands.

```tsx
// 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

## Source

https://patterns.dev/react/islands-architecture

## Process

1. Read the instructions and examples in this document.
2. Apply the patterns to your implementation, adapting to your specific context.
3. 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.

Files in this skill

  • SKILL.md2.7 KB
  • skill.yaml737 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.