Most JavaScript frameworks send the entire framework to the browser along with your page content. Even if 90% of your page is static text, the browser still downloads and executes JavaScript to render it. This hurts performance, especially on mobile. Astro takes the opposite approach: render everything to HTML on the server and only ship JavaScript for the specific interactive components that actually need it.
The result is sites with dramatically lower JavaScript payloads and better Lighthouse scores — which matters for SEO, user experience, and especially for content sites where most visits are read-only.
Key Takeaways
- Astro ships zero JavaScript to the browser by default — pages are pure HTML for maximum performance
- Islands architecture lets you add interactive components selectively without shipping a full JavaScript framework
- Content Collections provide type-safe access to Markdown and MDX files — ideal for blogs and documentation
- Astro works with React, Vue, Svelte, and others — not locked into one ecosystem
- Choose Astro for content sites; choose Next.js for applications with complex client state or auth
Islands Architecture Explained
The "islands" metaphor: most of a web page is static HTML (the ocean) with small interactive areas (islands) scattered throughout — a navigation toggle, a newsletter form, an image carousel.
Full Framework, Always
The entire React runtime ships to every visitor, even for a blog post that has no client-side interactivity. 200KB+ of JavaScript on first load. Every page is a JavaScript app. Fast to develop, heavy to ship.
Static + Selective Hydration
The page is pure HTML. Interactive islands (a search bar, a like button) load only their own JavaScript, only when needed. A blog post with no interactive components ships literally 0KB of JS.
--- import Counter from './Counter.jsx'; import SearchBar from './SearchBar.vue'; --- <!-- Static HTML - zero JS sent --> <h1>My Blog</h1> <!-- Hydrated immediately on page load --> <Counter client:load /> <!-- Hydrated when visible (better for below-fold) --> <SearchBar client:visible /> <!-- Hydrated on idle (low priority) --> <Newsletter client:idle />
Content Collections: Type-Safe Markdown
Content Collections are Astro's solution for managing large amounts of Markdown or MDX content. Define a schema for your content type, and Astro provides type-safe access to all your files.
import { z, defineCollection } from 'astro:content'; const blog = defineCollection({ schema: z.object({ title: z.string(), description: z.string(), pubDate: z.date(), tags: z.array(z.string()).optional() }) }); export const collections = { blog };
Astro vs Next.js: Which to Choose
Best for Content Sites
Blogs, documentation, marketing pages, portfolios. Most content is static. SEO performance matters. You want maximum Lighthouse scores. Few interactive features. The framework gets out of your way.
Best for Web Applications
Authentication, complex client state, real-time features, full-stack data fetching. You need React's component ecosystem. Server Actions and App Router are powerful. More JavaScript is acceptable for the use case.
Astro Supports It Too
Astro started as a static site generator but added full SSR. Configure output: 'server' for fully dynamic pages, output: 'hybrid' for mixed static/dynamic, or output: 'static' for a pure static build.
React in Astro
Not locked in. Install @astrojs/react and use your existing React components. Mix React, Vue, and Svelte on the same page. Components render static HTML by default; add client: directives to make islands interactive.
Build fast, modern web apps. In person, in two days.
The Precision AI Academy 2-day bootcamp covers modern frontend frameworks, AI integration, and production deployment. 5 cities. $1,490. June–October 2026 (Thu–Fri).
Reserve Your Seat →