Partial hydration means only some components on a page are hydrated, while the rest stay as static HTML with no JavaScript. Progressive hydration means the components that do hydrate are hydrated over time, in order of need (when idle, when visible, on interaction) rather than all at once on load. They answer different questions, which parts and when, and Astro does both: client:* directives choose which components hydrate, and the directive type chooses when.
The two terms are often mixed up, along with “islands”, “selective hydration”, “lazy hydration” and “resumability”. This explainer separates them, with examples in Astro and a comparison of how other frameworks approach the same problem.
Key Takeaways
- Full hydration: the whole page’s component tree hydrates on load. Simple, but every component pays the JavaScript cost.
- Partial hydration: only marked components hydrate. Static parts ship no JavaScript at all. It answers “which parts?”
- Progressive hydration: hydration is spread over time by priority. It answers “when?”
- Astro’s islands are partial by default (only
client:*components hydrate) and progressive per island (client:idle,client:visible,client:media).- Resumability (Qwik) avoids hydration altogether by serializing state and listeners, a different trade-off.
Start with full hydration
To see what partial and progressive hydration fix, start with the default in a typical server-rendered single-page app:
- The server renders the whole page to HTML and sends it.
- The browser shows the HTML. It looks ready but isn’t interactive.
- The browser downloads the JavaScript for every component on the page.
- The framework runs every component again in the browser, builds its component tree and attaches handlers to the existing DOM.
- Now the page is interactive.
Steps 3 and 4 scale with the size of the page, not with how much of it is interactive. A blog post with one “like” button still downloads and hydrates the header, footer, article body and sidebar. On a slow phone, that’s main-thread time during which taps are delayed, which shows up as poor Interaction to Next Paint (INP).
Partial hydration: which parts
Partial hydration says: only hydrate the components that need interactivity. Everything else is rendered to HTML on the server and left alone. There’s no JavaScript for those parts in the bundle and no hydration work in the browser.
In Astro, partial hydration is the default. A component hydrates only if you add a directive:
---
// src/pages/blog/[slug].astro
import Header from '../../components/Header.astro';
import Article from '../../components/Article.astro';
import LikeButton from '../../components/LikeButton.jsx';
import Footer from '../../components/Footer.astro';
---
<Header />
<Article />
<LikeButton client:load postId="123" />
<Footer />
Only LikeButton ships JavaScript. The page’s bundle is the like button and the React runtime, not the whole page. Remove the directive and the page ships zero JavaScript.
Each hydrated component is an island: an interactive region in a static page, hydrated independently of the others. “Islands architecture” is the design pattern; partial hydration is the mechanism that makes it work. The islands architecture explainer covers the broader idea.
Progressive hydration: when
Progressive hydration says: of the components that do need hydration, don’t do them all at once. Hydrate the urgent ones first and the rest later, when the browser is idle, when they scroll into view, or when the user is about to interact.
Astro’s directives encode this per component:
<SearchBox client:load /> <!-- needed immediately -->
<Newsletter client:idle /> <!-- after main work is done -->
<Comments client:visible /> <!-- when scrolled into view -->
<MobileMenu client:media="(max-width: 768px)" /> <!-- only on small screens -->
The page loads, SearchBox hydrates straight away, Newsletter waits until requestIdleCallback fires, Comments waits for an IntersectionObserver hit, and MobileMenu never hydrates on desktop. Hydration work is spread out instead of piling up during load.
You can have progressive hydration without partial hydration: a framework could hydrate the entire page, but in chunks over time. And you can have partial without progressive: hydrate only the islands, but all of them immediately. Astro combines both, which is why a long page with several islands can still have a quiet main thread on load.
Side by side
| Full hydration | Partial hydration | Progressive hydration | Astro islands | |
|---|---|---|---|---|
| What hydrates | Everything | Only marked components | Everything, or marked components | Only client:* components |
| When | All at once, on load | On load | Spread over time by priority | Per directive |
| JS for static content | Yes | No | Yes, unless also partial | No |
| Main thread on load | Busiest | Lighter | Lighter, spread out | Lightest |
| Developer effort | None | Mark interactive parts | Choose priorities | Choose directive per island |
Related terms
Lazy hydration
Usually a synonym for progressive hydration in practice: hydrating a component later than page load, on a trigger such as visibility or interaction. Astro’s client:visible and client:idle are lazy hydration. Several other frameworks have added similar primitives, for example lazy hydration options in Nuxt and incremental hydration with @defer triggers in Angular.
Selective hydration
A React 18 term. With streaming server rendering and <Suspense> boundaries, React can hydrate parts of the page independently and prioritize the boundary the user interacts with first. It’s progressive in spirit, but every component on the page is still a client component that eventually hydrates, so it isn’t partial.
React Server Components
Server Components render only on the server and send no component JavaScript to the browser; only components marked 'use client' hydrate. That’s partial hydration achieved through a component model rather than a directive. The islands vs React Server Components comparison goes into the differences.
Resumability
Qwik’s approach avoids hydration. The server serializes the application state and event listener references into the HTML. The browser doesn’t re-run components on load; when the user interacts, it loads just the code for that handler and resumes from the serialized state. The cost of hydration goes to near zero, at the price of a different programming model and framework.
Progressive enhancement
Not a hydration strategy, but closely related. The page works as plain HTML (links navigate, forms submit) and JavaScript adds improvements when it loads. Astro encourages this: if an island fails to load, the server-rendered HTML is still there. Forms built on native <form> elements work before hydration and with JavaScript disabled.
Choosing directives in practice
A rule of thumb for each component on a page:
- Does it need JavaScript at all? If not, keep it as an
.astrocomponent. That’s partial hydration doing its job. - Could a small
<script>do it? Toggles, accordions and copy buttons often don’t need a framework. The island or script guide helps decide. - Is it needed the moment the page appears? Use
client:load. Rare: a search box at the top, a checkout form. - Is it above the fold but not urgent?
client:idle. - Is it below the fold?
client:visible, optionally withrootMarginto start a little early. - Is it only relevant on some screens?
client:media. - Can it not render on the server at all?
client:only="framework", and give it a fixed-size container to avoid layout shift.
The client directive decision guide works through these with examples, and the hydration explainer shows what each directive does in the browser.
How to see the difference
Build the site and compare pages in Chrome DevTools:
- Run
npm run build && npm run preview. - Open the Network panel, filter by JS, and reload. With partial hydration, a page without islands loads no component JavaScript; a page with one island loads that island’s chunk and its framework renderer.
- Switch a below-the-fold island from
client:loadtoclient:visible, rebuild, and reload. Its chunk now loads only when you scroll to it. - In the Performance panel, record a load before and after. Long tasks during load shrink as hydration moves later or disappears.
For field data, compare INP in your analytics or Search Console after the change. The Astro Core Web Vitals guide covers measurement.
Komal themes are built on this model: Astro components with no client JavaScript by default, and directives only where a component needs interaction. If you want a finished project to inspect, browse Astro themes and open a live preview in DevTools; the getting started docs explain how to run one locally. The official Astro islands documentation describes the model in Astro’s own words.
FAQ
What is partial hydration?
Partial hydration is hydrating only the interactive components on a page and leaving the rest as static HTML with no JavaScript. In Astro, only components with a client:* directive hydrate.
What is progressive hydration?
Progressive hydration spreads hydration over time instead of doing it all on page load, hydrating components in priority order, such as when the browser is idle or when a component scrolls into view.
Does Astro use partial or progressive hydration?
Both. Astro hydrates only components marked with a client:* directive, which is partial hydration, and directives like client:idle, client:visible and client:media delay each island’s hydration, which is progressive hydration.
Is partial hydration the same as islands architecture?
They’re closely linked. Islands architecture is the design pattern of interactive regions inside a mostly static page; partial hydration is the technique that makes it possible by hydrating only those regions.
What is the difference between hydration and resumability?
Hydration re-runs component code in the browser to attach interactivity to server-rendered HTML. Resumability, used by Qwik, serializes state and listeners into the HTML so the browser doesn’t re-run components and only loads code when the user interacts.