What Is Astro? The Content-First Framework

Photo: Ayden Zaki / Pexels
Most modern web frameworks ship hundreds of kilobytes of JavaScript to a browser just to render a blog post. Astro does the opposite: it ships zero JavaScript by default and only adds interactivity to the specific pieces of a page that need it. This idea has a name — Islands Architecture — and it's the reason Astro sites routinely score 100/100 on Lighthouse without anyone trying.
Astro launched in 2021 by the team behind Snowpack (Fred K. Schott and collaborators). It hit 1.0 in August 2022, and Astro 5 shipped in late 2024 with stable view transitions and Server Islands. As of 2026, Astro is the default choice for content-heavy sites — blogs, documentation, marketing pages — among teams that care about performance.
The Core Idea: Ship Less JavaScript
A typical Next.js page sends an HTML payload plus a JavaScript bundle that re-renders the entire page on the client (hydration). Even for a static blog post, you pay the cost of hydrating React on every load.
Astro inverts this. The default output is HTML and CSS, no JavaScript. If a specific component needs interactivity — a search box, an image carousel, a comment widget — you mark only that component as an "island" and it hydrates independently. Everything else stays as static HTML.
For a 5,000-word article with one interactive search box, Next.js might ship 200 KB of JS. Astro ships 5 KB.
Islands Architecture, Explained
The term was coined by Katie Sylor-Miller (Etsy) and popularized by Jason Miller (Preact). The model:
- The page is a sea of static HTML.
- Islands of interactivity are scattered throughout, each hydrated independently.
- Islands can use different UI frameworks on the same page — a React search box next to a Vue chart next to a Svelte counter.
- Islands hydrate on demand: when visible, when idle, when the user interacts.
Astro's directives make this declarative:
<Counter client:load /> <!-- hydrate immediately -->
<Chart client:visible /> <!-- hydrate when scrolled into view -->
<Search client:idle /> <!-- hydrate when browser is idle -->
<Modal client:media="(min-width: 768px)" /> <!-- hydrate on breakpoint -->
<HeavyWidget client:only="react" /> <!-- skip SSR, render client-side -->
This is the framework's defining feature. Nothing else works this way out of the box at this granularity.
The .astro File Format
Astro components live in .astro files that look like HTML with a JavaScript-ish front matter:
---
// Component script — runs at build time (or SSR), never in the browser
import Layout from '../layouts/Base.astro';
import PostCard from '../components/PostCard.astro';
const posts = await Astro.glob('./posts/*.md');
const featured = posts.filter(p => p.frontmatter.featured);
---
<Layout title="Blog">
<h1>Latest posts</h1>
<div class="grid">
{featured.map(post => <PostCard post={post} />)}
</div>
</Layout>
<style>.grid { display: grid; gap: 1rem; }
</style>
The fence (---) separates the component script (build-time JavaScript) from the template (HTML + JSX-like expressions). The bottom <style> block is scoped to this component automatically. There is no useState, no client lifecycle — the script runs once at build time and disappears.
File-Based Routing
Familiar if you've used Next.js:
src/pages/
index.astro → /
about.astro → /about
blog/[slug].astro → /blog/anything
blog/[...path].astro → /blog/nested/deep/paths
Dynamic routes get parameters via Astro.params. Static paths are declared with getStaticPaths():
---
export async function getStaticPaths() {
const posts = await fetch('https://api.example.com/posts').then(r => r.json());
return posts.map(post => ({ params: { slug: post.slug }, props: { post } }));
}
const { post } = Astro.props;
---
<article>{post.body}</article>
Use Any UI Framework — Or Several
Astro doesn't have its own component model for interactivity. It integrates with everything:
@astrojs/react@astrojs/vue@astrojs/svelte@astrojs/solid-js@astrojs/preact@astrojs/lit@astrojs/mdx
You can ship a React search component, a Svelte counter, and a Vue carousel on the same page. Each only ships its framework's runtime when hydrated.
Content Collections
Introduced in Astro 2.0, content collections give type-safe access to Markdown/MDX/JSON content:
// src/content/config.ts
import { defineCollection, z } from 'astro:content';
const blog = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
publishedAt: z.date(),
tags: z.array(z.string()),
draft: z.boolean().default(false),
}),
});
export const collections = { blog };
Now getCollection('blog') returns typed entries with autocomplete on frontmatter fields. Bad frontmatter fails the build with a Zod error.
SSR, SSG, and Hybrid
Astro supports three output modes:
- Static (default) —
output: 'static'. Pre-renders every page at build time. Deploy to any CDN. - Server —
output: 'server'. Every request is SSR'd. Use with adapters (Node, Vercel, Cloudflare, Netlify, Deno). - Hybrid — most pages static, opt specific routes into SSR with
export const prerender = false.
Hybrid is the typical pick: 99% of pages prerender, the /dashboard and /api/* routes run on demand.
Astro 5 Features (Late 2024)
- Server Islands — render most of a page statically, then stream a server-rendered island into a placeholder slot. Solves the "personalized header on a CDN-cached page" problem.
- Stable View Transitions — the
<ClientRouter />component delivers SPA-like transitions on a multi-page architecture using the View Transitions API. - Content Layer API — load content from any source (CMS, database, files) with the same type-safe interface.
astro:env— typed environment variables with build-time validation.
Astro vs Next.js vs Hugo vs Eleventy
| Dimension | Astro | Next.js | Hugo | Eleventy |
|---|---|---|---|---|
| Primary use case | Content sites | Apps + content | Static blogs | Static sites |
| Default JS shipped | Zero | Full hydration | Zero | Zero |
| Islands hydration | Yes (granular) | No | No | No (manual) |
| UI framework | Multi (React/Vue/Svelte) | React only | None (Go templates) | None (Nunjucks/Liquid) |
| TypeScript | Native | Native | No | Optional |
| Build speed | Fast | Moderate | Fastest | Fast |
| SSR support | Yes (adapters) | Yes (first-class) | No | No |
| Learning curve | Low | Moderate | Low | Low |
| Best for | Blogs, docs, marketing | Web apps, e-commerce | Personal blogs | Designer-friendly sites |
| Backed by | Astro (independent) | Vercel | Independent | Independent (Zach Leatherman) |
Pick Astro when: content is the product, performance matters, you might want a small interactive piece (search, comments) without committing to a full SPA.
Pick Next.js when: the whole site is an app — dashboards, account flows, complex client state. Next's hydration model isn't wasteful when you actually need the JavaScript.
Pick Hugo when: you want raw speed for a personal blog, don't need JavaScript anywhere, and Go templates don't scare you.
Pick Eleventy when: you want a thin layer over HTML with maximum flexibility and you're comfortable wiring your own asset pipeline.
For broader context on the React/Next side of this equation see articles on TypeScript and modern build tooling.
CMS and Headless Integrations
Astro pairs naturally with headless content sources:
- Sanity —
@sanity/astrointegration with live preview. - Contentful — REST or GraphQL via
contentfulSDK. - Headless WordPress — WPGraphQL or REST API.
- Storyblok, Strapi, Hygraph, Prismic — all have official starters.
- Markdown / MDX in repo — content collections.
The Astro DB and Astro Studio products provide a built-in SQLite-backed option, useful for small apps that need persistence without a full backend.
Performance Reality Check
Astro sites routinely hit:
- Lighthouse Performance: 100
- Total Blocking Time: 0 ms
- Cumulative Layout Shift: 0
- First Contentful Paint: under 1s on cable
These aren't theoretical — they fall out of "no JavaScript" almost automatically. The main ways to break them are: adding too many client:load islands, large unoptimized images (use astro:assets), or shipping a CMS-supplied stylesheet without scoping.
FAQ
Q: Can I build a web app like Linear or Notion in Astro? A: Not its strength. Astro is designed for content-heavy, mostly static experiences. For dense, app-like UIs with global client state across many components, Next.js, Remix, or SvelteKit fit better.
Q: Does Astro require Node.js to serve? A: No. Static-output Astro sites are plain HTML/CSS/JS deployable to any CDN — Cloudflare Pages, Netlify, S3, GitHub Pages. Server mode requires a runtime adapter.
Q: Why use multiple UI frameworks on one page? A: Usually you wouldn't deliberately, but Astro lets you reuse an existing component (say a Vue chart library) inside a mostly-React project without rewriting. The islands stay isolated.
Q: How does Astro compare to Qwik? A: Both minimize shipped JavaScript. Qwik uses resumability (no hydration at all, components resume from serialized state). Astro uses islands (hydrate specific components). Qwik is better for apps; Astro is better for content with interactive islands.
Q: Does SEO work well with Astro? A: Exceptionally well. Pre-rendered HTML, fast load times, and clean semantic output are exactly what crawlers reward. Most Astro starter templates ship with sitemap and RSS integrations.
Q: Can I migrate a Next.js blog to Astro?
A: Yes, and it's common. The mental model is similar (file-based routing, getStaticPaths, MDX content). The migration mostly means converting React components to .astro for static pieces and keeping React only for true interactivity.
Sources
- Astro documentation — docs.astro.build
- Astro 5 release notes, December 2024 — astro.build/blog/astro-5
- "Islands Architecture," Jason Miller, 2020 — jasonformat.com/islands-architecture
- Katie Sylor-Miller, Etsy — origin of "islands" terminology
- Astro GitHub repository — github.com/withastro/astro
- "Why Astro?" — docs.astro.build/en/concepts/why-astro
Read next:
Follow new articles
Add SciHub101 to your feed reader to see new science and technology stories.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. AI tools assist with drafting and research. Source documentation in the existing archive is uneven, and articles are being reviewed and corrected. The Editorial Team byline identifies editorial responsibility; it does not certify specialist or independent human review. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.
Related Articles

What Is uv? The Fast Python Package Manager
uv is a Rust-based Python package manager from Astral, 10-100x faster than pip. Here's what it does, when to use it, and how it compares to poetry.

Bun vs Node.js vs Deno — 2026 Comparison
Bun is fastest, Node is bulletproof, Deno is the most secure. A 2026 comparison of the three major JavaScript runtimes with benchmarks and trade-offs.

React vs Vue vs Svelte 2026 — Which Framework to Learn?
Compare React, Vue, Svelte side-by-side. Job market demand, learning curve, salary, real-world usage. Which one to choose.

Zustand vs Redux — React State Management
Zustand vs Redux compared: bundle size, boilerplate, API, when to use each, plus how Jotai, Valtio, MobX, and TanStack Query fit in 2026.

What Is HTMX? Hypermedia for Modern Web
HTMX explained: how this 14KB library lets you build dynamic web apps with HTML attributes instead of a JavaScript framework, plus how it actually works.

React Hooks Explained — useState and useEffect
React Hooks explained from scratch: how useState and useEffect work, the dependency array, cleanup, Strict Mode, common bugs, and when not to use an effect.