komal.nakrani
Browse Themes
ThemesCategoriesDocsBlogTips & Tricks
Astro Fundamentals••By Komal Nakrani

30 Astro Questions, Answered

Short, direct answers to 30 common Astro questions: what it is, cost, SEO, React, CMS, hosting, SSR, images, versions and themes, each linking to a deeper guide.

#Astro#FAQ#Questions

These are the Astro questions people ask most often, in search, in forums and in AI assistants, answered in two or three sentences each for Astro 7. Each answer links to a guide or tip with the full detail. Questions are grouped into getting started, building, content, deployment and choosing Astro.

Key Takeaways

  • Astro is a free, open-source framework for content-driven sites that ships zero JavaScript by default.
  • It works with React, Vue, Svelte, Solid and Preact, and doesn’t require any of them.
  • It’s static by default and renders on demand with an adapter.
  • Astro 7 requires Node.js 22.12 or newer.

Getting started

What is Astro?

A web framework for content-driven websites that renders pages to HTML and ships no JavaScript unless a component opts in. See What is Astro?.

Is Astro free?

Yes. It’s open source under the MIT licence. Static Astro sites can be hosted free on several providers.

What do I need to install Astro?

Node.js 22.12 or newer, then npm create astro@latest.

Do I need to know React to use Astro?

No. Astro components use HTML with JavaScript expressions. React is optional.

How long does it take to learn Astro?

If you know HTML, CSS and some JavaScript, a basic site is a matter of hours. Collections, routing and islands take a few days of use to feel natural.

What’s the latest version of Astro?

Astro 7 is the current major version as of October 2026.

Building

Can I use React components in Astro?

Yes. Run npx astro add react. Components render to HTML, or hydrate with a client:* directive. See the Astro components guide.

What is an island in Astro?

An interactive component on an otherwise static page, hydrated on its own. See the Astro glossary.

Which client directive should I use?

client:visible for most below-the-fold components, client:load only for controls people use immediately. See which client directive to use.

Does Astro support TypeScript?

Yes, out of the box. Run npx astro check to type-check.

Can I use Tailwind CSS with Astro?

Yes: npx astro add tailwind. See the Astro styling guide.

How do I add dark mode?

CSS variables that change under a data-theme attribute, plus an inline script in <head> that sets it before paint. Covered in the Astro styling guide.

How do I handle forms on a static Astro site?

Post to a form service or your email provider, or add an adapter and use Astro Actions. See newsletter signup forms.

Content

How do I make a blog with Astro?

Define a content collection for Markdown posts, add an index page and a [slug].astro route. See the content collections guide.

Does Astro support MDX?

Yes, with npx astro add mdx.

Can I use a headless CMS with Astro?

Yes. Most CMSs work through a content loader or fetch(). See choosing a headless CMS for Astro.

How do I add a sitemap?

npx astro add sitemap and set site in config. See add a sitemap to Astro.

How do I optimise images in Astro?

Import them and use <Image /> or <Picture /> from astro:assets. See the image props cheatsheet.

Deployment

Where can I host an Astro site?

Any static host: Cloudflare Pages, Netlify, Vercel, GitHub Pages, or a server. See the Astro deploy guide.

Do I need a server to run Astro?

Not for static sites. You need one (via an adapter) only for on-demand pages, actions, sessions or server islands.

Does Astro support SSR?

Yes, with an adapter and export const prerender = false per page or output: 'server'.

How do I use a custom domain?

Add it in your host, set the DNS records, then update site in config. See point a custom domain at your Astro site.

Why does my Astro build fail on the host but work locally?

Usually an older Node version, a missing environment variable, or a file-name case mismatch. The error fixes in Tips & Tricks cover specific messages.

Choosing Astro

Is Astro good for SEO?

Yes. It outputs complete HTML and loads fast by default. You still need titles, descriptions and a sitemap; see the Astro SEO checklist.

Is Astro faster than Next.js?

For content pages it usually ships far less JavaScript. See Astro vs Next.js.

Is Astro good for e-commerce?

For content-heavy storefronts with a cart or hosted checkout, yes. For app-like shopping flows, compare it with app frameworks.

Is Astro good for web apps?

For apps where most screens are interactive, an app-focused framework is usually a better fit. Astro handles sites with some app features well.

Should I use Astro or Starlight for docs?

Starlight, unless docs must match a custom branded site. See plain Astro or Starlight.

Are there free Astro themes?

Yes: AstroWind, AstroPaper and Starlight, plus the official directory. See the best Astro themes.

Can I use an Astro theme for client work?

Depends on the licence. MIT themes allow it; Komal themes include a commercial licence for client sites.

The full Astro documentation is at docs.astro.build.