Explained

Astro's islands architecture, explained in plain language

What is Astro's islands architecture? How interactive islands keep your site fast by loading JavaScript only where it is genuinely needed.

Astro's islands architecture: interactivity only where it is needed.

Most modern websites send a full JavaScript application to your browser, which then builds the page there. That is powerful for genuine apps, but overkill for a site that mostly shows content. Astro’s islands architecture is the answer to that: it keeps the page light by limiting interaction to separate islands. It sounds technical, but the idea is surprisingly simple.

The idea in one sentence

An Astro page is static HTML. The parts that need interaction, such as a carousel, a search bar or a pricing calculator, become isolated islands with their own JavaScript. Everything in between stays plain HTML, with no JavaScript.

Why is the classic approach slow?

With a classic single-page app, the browser first has to download and run the entire application before anything is visible and usable. That costs time and processing power, especially on an average phone. You pay the full JavaScript cost, even for pages that barely have any interaction.

With islands, the browser gets to see the page as HTML right away. The islands load afterwards, independently of each other. A heavy widget at the bottom does not slow down the button at the top, because each island stands on its own.

What exactly is an island?

An island is a bounded, interactive component on an otherwise static page. Think of a filter bar in a product overview, a form or a video player. Astro first renders the HTML of that component (so it is visible right away), and then “hydrates” it: its accompanying JavaScript loads and makes it interactive. Outside those islands there is simply no component JavaScript to load.

When does an island load?

This is the key to the speed. You decide per island when it hydrates with a directive. That way you load nothing too early.

Directive When it loads Good for
client:load Immediately when the page loads Anything that must be interactive right away
client:idle As soon as the browser has a moment to spare Less urgent widgets
client:visible Only when the component scrolls into view Anything below the fold
client:media At a certain screen width Mobile-specific interaction
client:only In the browser only, no server HTML Components that cannot be pre-rendered

A chat widget that only loads once someone scrolls down costs nothing when the page opens. That is interaction without the visitor paying for it on first impression.

Server islands

Alongside interactive islands in the browser, there are server islands. These render a dynamic or personal part (for example a logged-in name, live stock levels or a personalised recommendation) separately on the server, while the rest of the page stays static and cacheable. This way you combine the speed of static HTML with dynamism exactly where it is needed, without making the entire page dynamic.

Bring your own framework

Astro does not force a framework choice on you. You write components in .astro, and you can use React, Svelte, Vue or Solid alongside them for the islands, even mixed together in the same project. Astro strips out the runtime where you do not need it, so visitors only receive HTML and CSS unless interaction calls for more. You therefore reuse existing components without the performance price of a full client-side app.

What it means for your site

The practical gain is twofold. Your site loads faster, because there is less JavaScript to process, which directly helps your Core Web Vitals. And your site stays manageable, because interaction is neatly bounded instead of woven throughout a large application. For content-focused sites that is almost always the better trade-off. You can read more about the consequences for findability in Core Web Vitals and SEO.

Common misconceptions

  • “Islands means no JavaScript.” Not true: you can add as much interaction as you want, you only pay for it where you place it.
  • “It is the same as lazy loading.” Lazy loading defers the loading of a resource; islands additionally isolate the interaction per component, with server HTML underneath.
  • “You have to choose between static and dynamic.” With server islands you do not: static main content and dynamic parts live together on a page.

Conclusion

The islands architecture is not a trick, but a different default: send nothing, unless it is needed. That is exactly why an Astro site feels light, even with a lot of content or several interactive parts. If you want to see it in action, take a look at the release calendar, which is itself built with this approach, or read what Astro actually is.

FAQ

Frequently asked questions

What is an island in Astro?

An island is an interactive component (such as a carousel or a search bar) that loads its own JavaScript. The rest of the page stays static HTML with no JavaScript.

Why is that faster?

Because the browser only gets JavaScript for the islands that genuinely need it, instead of downloading and running a full app for the entire page.

What is hydration?

Hydration is the moment static HTML becomes interactive as its accompanying JavaScript loads and attaches itself to the markup. In Astro this happens per island, and only when you want it to.

Can I use React or Vue inside an island?

Yes. Astro supports React, Svelte, Vue, Solid and other frameworks alongside its own .astro components, and only loads their runtime where you place an island.

What are server islands?

Server islands render a dynamic or personal part of the page separately on the server, so the main content can stay static and cacheable.

When do I use which loading strategy?

Use client:load for anything that must be interactive right away, client:idle for less urgent widgets, and client:visible for anything that only matters once it scrolls into view, such as a component at the bottom of the page.

Sources and references

Astro (official)

AstroIslandsPerformanceJavaScriptHydration

Back to the blog