🔥 All-Access Pass — $199 USD (Regular $499) · Unlock all 2,836 Astro themes ➔
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
Comparisons••By Komal Nakrani

Astro React vs Svelte vs Vue: Which Island Framework?

Astro React vs Svelte vs Vue for islands: runtime cost, syntax, ecosystem, slots and shared state compared, with setup code and a clear rule for picking one.

#Astro#React#Svelte#Vue#Islands

In the Astro React vs Svelte debate (with Vue as the third option), the short answer is: pick Svelte when you are starting fresh and want the smallest islands, pick React when you already have React components or need its ecosystem, and pick Vue when your team already writes Vue. All three work as Astro islands through official integrations, render to HTML on the server, and only ship JavaScript to the browser when you add a client:* directive.

Key Takeaways

  • Astro treats React, Svelte and Vue the same way: server-rendered HTML first, hydration only with client:*.
  • Svelte compiles components to small JavaScript with a light runtime, so it usually ships the least code per island.
  • React has the largest runtime of the three, and the largest ecosystem of ready-made components.
  • Vue sits between them and has the gentlest learning curve for people coming from HTML templates.
  • Stick to one framework per site where you can; each extra framework adds its own runtime to the pages that use it.

How islands work in Astro, whatever the framework

An island is a framework component placed in an .astro page. Astro renders it to HTML at build time (or request time for on-demand pages). Without a directive, that HTML is all the browser gets: no framework code, no hydration. Add client:load, client:idle, client:visible, client:media or client:only and Astro ships the component’s JavaScript plus the framework runtime, then hydrates that one piece of the page.

---
// src/pages/index.astro
import Counter from '../components/Counter.jsx';      // React
import Search from '../components/Search.svelte';     // Svelte
import Newsletter from '../components/Newsletter.vue'; // Vue
---
<Counter client:visible />
<Search client:idle />
<Newsletter client:visible />

This is why the framework choice matters less in Astro than in a single-page app. Most of your site is .astro components that ship zero JavaScript. The framework only affects the handful of interactive pieces. If you are new to the directives, the client directive decision guide walks through when to use each one.

Astro React vs Svelte vs Vue at a glance

React Svelte Vue
Integration @astrojs/react @astrojs/svelte @astrojs/vue
Install npx astro add react npx astro add svelte npx astro add vue
File type .jsx / .tsx .svelte .vue
Runtime shipped Largest of the three Smallest; mostly compiled away Medium
Reactivity model Hooks (useState, useEffect) Runes ($state, $derived) Refs and reactive objects
Ecosystem Largest: UI kits, form libraries, charts Smaller, growing Large, especially in Asia and Laravel shops
Learning curve Moderate (JSX, hook rules) Low (HTML plus a little syntax) Low (HTML templates)
Best fit Reusing existing React code Small, fast widgets on content sites Teams already on Vue or Nuxt

The runtime row is the one that shows up in your Lighthouse report. React needs react and react-dom in the browser for any hydrated island. Svelte compiles each component into direct DOM updates, so the shared runtime is small. Vue ships its runtime too, but it is lighter than React’s. Measure your own pages with a bundle analyzer rather than trusting any single number; the bundle size analysis tip shows how.

Setting each one up

Each framework is one command away. astro add installs the integration and the framework packages, then edits astro.config.mjs for you.

npx astro add react
npx astro add svelte
npx astro add vue

The resulting config with all three looks like this:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import svelte from '@astrojs/svelte';
import vue from '@astrojs/vue';

export default defineConfig({
  integrations: [react(), svelte(), vue()],
});

Svelte and Vue have their own file extensions, so Astro always knows which renderer to use. React uses JSX, which Preact and Solid also use. If you combine React with another JSX framework, tell each integration which files it owns with include:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import preact from '@astrojs/preact';

export default defineConfig({
  integrations: [
    react({ include: ['**/react/*'] }),
    preact({ include: ['**/preact/*'] }),
  ],
});

The same component in all three

A counter is the classic comparison because it shows state, events and rendering in a few lines.

React:

// src/components/Counter.jsx
import { useState } from 'react';

export default function Counter({ start = 0 }) {
  const [count, setCount] = useState(start);
  return (
    <button type="button" onClick={() => setCount(count + 1)}>
      Clicked {count} times
    </button>
  );
}

Svelte 5:

<!-- src/components/Counter.svelte -->
<script>
  let { start = 0 } = $props();
  let count = $state(start);
</script>

<button type="button" onclick={() => count++}>
  Clicked {count} times
</button>

Vue:

<!-- src/components/Counter.vue -->
<script setup>
import { ref } from 'vue';
const props = defineProps({ start: { type: Number, default: 0 } });
const count = ref(props.start);
</script>

<template>
  <button type="button" @click="count++">Clicked {{ count }} times</button>
</template>

All three are used identically from Astro: <Counter start={5} client:visible />. Props you pass from an .astro file must be serializable (strings, numbers, arrays, plain objects, dates and a few other types), because Astro serializes them into the HTML for hydration. Functions cannot be passed as props to a hydrated island.

Runtime cost and performance

Performance is where people expect a clear winner, and in Astro the differences are real but smaller than on a single-page app.

  • Svelte usually wins on bytes. Its compiler turns components into plain DOM operations, so a small widget ships little more than its own code. On a content site with two or three widgets, this is the lowest-cost option.
  • Vue ships a reactive runtime that every Vue island on the page shares. After the first island, extra Vue islands mostly cost their own component code.
  • React has the heaviest runtime, and it is paid once per page that hydrates any React island. On a marketing page with a single interactive form, that runtime can be larger than the rest of the page’s JavaScript combined.

Two practical points matter more than the framework:

  1. Directive choice. client:visible on a below-the-fold island means the framework runtime never downloads for visitors who don’t scroll. That often saves more than switching frameworks.
  2. Framework count. Using React for one island and Vue for another ships both runtimes. One framework per site keeps the cost predictable.

If an island only toggles a class or opens a menu, you may not need a framework at all. The island or script guide covers when a plain <script> is the better call.

Children, slots and passing content

Astro lets you pass HTML from an .astro file into a framework component as children. Each framework receives it in its own way.

---
// src/pages/pricing.astro
import Card from '../components/Card.jsx';
---
<Card client:visible>
  <h2 slot="title">Pro plan</h2>
  <p>Everything in Starter, plus priority builds.</p>
</Card>
  • React receives the default content as children and named slots as top-level props, so slot="title" arrives as a title prop.
  • Vue receives normal <slot /> and named <slot name="title" /> content.
  • Svelte receives the children through its own slot or snippet mechanism, depending on the Svelte version.

Children passed this way are rendered by Astro as static HTML. They are not themselves interactive framework components inside the island’s tree, which surprises people coming from React. If a child needs to be interactive, import it inside the framework component instead.

Sharing state between islands

Islands are independent apps. A React cart button and a React cart drawer on the same page don’t share a React context, because each one hydrates separately. The Astro docs recommend Nano Stores for this, and it works across all three frameworks.

npm install nanostores @nanostores/react @nanostores/vue
// src/stores/cart.js
import { atom } from 'nanostores';
export const cartCount = atom(0);
// src/components/CartButton.jsx
import { useStore } from '@nanostores/react';
import { cartCount } from '../stores/cart.js';

export default function CartButton() {
  const count = useStore(cartCount);
  return <button type="button">Cart ({count})</button>;
}

Svelte can read a Nano Store directly with the $cartCount store syntax, and Vue uses useStore from @nanostores/vue. Because the store is framework-agnostic, it is also the cleanest way to migrate gradually from one framework to another.

Ecosystem and hiring

This is React’s strongest argument. Date pickers, data grids, chart libraries, headless UI kits and form libraries tend to appear for React first. If your island is a complex dashboard widget, the time saved by an existing React library can outweigh the runtime cost.

Vue has a large, mature ecosystem of its own, and many agencies already build in Vue through Nuxt. Svelte’s ecosystem is smaller, but most things Astro sites need (forms, search boxes, carousels, toggles) are small enough that you write them yourself in a few dozen lines anyway.

For hiring and handover, React is the most common skill, Vue is common in many regions and agency teams, and Svelte developers are fewer but usually pick up any Svelte codebase fast because there is less framework to learn.

Choose React, Svelte or Vue

Choose React if you already have React components, your team writes React daily, or the island needs a heavy library (data grid, rich text editor, charting) that only exists for React. Use client:visible or client:idle to keep the runtime off the critical path.

Choose Svelte if you are starting a new content site, the interactive pieces are small (search, filters, forms, toggles), and you care most about shipping the least JavaScript. It is the default recommendation for a fresh Astro project with a few widgets.

Choose Vue if your team already knows Vue, you are moving from Nuxt, or you like single-file components with HTML-style templates. It is a comfortable middle ground on size and ecosystem.

Choose none if the interaction is a menu, accordion, tab set or copy button. A <script> tag in an .astro component costs only your own code.

Most Komal themes ship without any framework island at all, because static .astro components and small scripts cover menus, tabs and forms. If you want to see that approach in a finished site, browse the Astro themes and open any live preview. To learn the component model first, read the Astro components guide or the official framework components docs.

FAQ

Can I use React, Svelte and Vue in the same Astro project?

Yes. Install each integration and Astro renders each component with the right renderer, even on the same page. The cost is that every framework used by a hydrated island on a page ships its own runtime to that page, so mixing them is best kept to migrations or one-off cases.

Is Svelte faster than React in Astro?

For the JavaScript that reaches the browser, Svelte islands are usually smaller, because Svelte compiles components and has a light runtime while React ships react-dom. Server rendering speed is rarely the bottleneck on an Astro site. Measure your own pages, since directive choice and the number of islands often matter more than the framework.

Do framework components in Astro ship JavaScript by default?

No. Without a client:* directive, a React, Svelte or Vue component renders to plain HTML and ships no JavaScript. You opt in per component with client:load, client:idle, client:visible, client:media or client:only.

Which framework does Astro recommend?

Astro does not recommend one. It provides official integrations for React, Preact, Svelte, Vue, Solid and Alpine.js, and treats them equally. Pick the one your team knows, or Svelte if you want the smallest islands and have no existing code to reuse.

How do I share state between React and Svelte islands in Astro?

Use a framework-agnostic store such as Nano Stores. Define an atom in a plain .js file, then read it with @nanostores/react in React and with the $store syntax in Svelte. Each island subscribes to the same store, so updates in one appear in the other.