Islands Architecture Playground

Experience Astro's partial hydration in action. Each component below uses a different hydration strategy—watch the status indicators to see when they become interactive.

i

What is Partial Hydration?

Traditional frameworks hydrate the entire page with JavaScript. Astro's Islands Architecture lets you choose exactly which components need JavaScript and when they should load it. The result: dramatically smaller bundles and faster pages.

Hydration Strategies

client:loadWaiting...

Hydrates immediately on page load. Use for above-the-fold interactive content.

0
client:idleWaiting...

Hydrates when browser is idle. Good for lower-priority interactions.

0
client:visibleWaiting...

Hydrates when scrolled into view. Perfect for below-the-fold content.

0
client:media="(min-width: 768px)"Waiting...

Hydrates only on larger screens. Ideal for desktop-only features.

0

Cross-Framework Monitoring

Svelte Status Monitor

Component Status: Static HTML
Framework: Svelte 5

This component uses Svelte 5 runes ($state) and demonstrates cross-framework coexistence.

Static Astro Component

This component ships zero JavaScript. It's pure HTML rendered at build time. The buttons below are decorative—they don't work because there's no JS.

0

The Code

Using Hydration Directives astro
---
import Counter from './Counter.tsx';
---

<!-- Hydrate immediately -->
<Counter client:load />

<!-- Hydrate when idle -->
<Counter client:idle />

<!-- Hydrate when visible -->
<Counter client:visible />

<!-- Hydrate based on media query -->
<Counter client:media="(min-width: 768px)" />

<!-- Client-only (skip SSR) -->
<Counter client:only="react" />

Bundle Impact

JavaScript Bundle Size Comparison

Approximate JS sent to browser for a typical interactive page

React SPA (typical) 142 KB
Vue SPA (typical) 95 KB
Svelte SPA (typical) 45 KB
Astro (this page) 12 KB
🚀

Astro ships 92% less JavaScript

By only hydrating interactive components, Astro dramatically reduces bundle size.

Key Takeaways

  • 1. Default is zero JS — Components render as static HTML unless you add a client directive.
  • 2. Granular control — Choose when each component hydrates based on its importance and position.
  • 3. Framework freedom — Mix React, Vue, Svelte, or any supported framework in the same page.
  • 4. Performance by default — Users get fast pages without you having to optimize manually.