Skip to content

Astro Foundations & Mental Model

Astro renders your pages to HTML on the server (at build time or per request) and ships zero JavaScript by default — you opt into interactivity, island by island. Most of a content site is static; Astro treats that as the default and makes the interactive parts explicit.

Every Astro feature — islands, client directives, content collections, server islands — is a consequence of that one commitment: send the browser finished HTML, and only the JavaScript it actually needs.

LessonWhat you’ll learn
Why Astro & islandsThe islands architecture and the zero-JS-by-default thesis
Project & .astro filesThe project layout and the .astro component (frontmatter + template)
The component modelAstro components, props, slots, and scoped styles
Rendering & output modesStatic (SSG) vs on-demand (SSR), and how the build works

Two ideas explain almost everything Astro does:

flowchart TB
  html["Server-first: render to HTML
(build time or per request)"] --> ship["Ship finished HTML,
no JS by default"]
  islands["Islands: opt into interactivity
per component, not per page"] --> ship
  ship --> fast["Fast pages,
minimal JavaScript"]
The two ideas everything builds on
  • Because Astro is server-first, your components run to produce HTML — the framework code and templating never reach the browser.
  • Because interactivity is opt-in via islands, a page can be 99% static HTML with one small interactive widget hydrated, instead of shipping a whole framework to run the entire page.

Hold those two and Astro’s design stops feeling like a pile of directives and starts feeling like one coherent bet.

What does Astro ship to the browser by default?
What is the "islands architecture"?
What does "server-first" mean in Astro?