ENATIV Logo
ENATIV
Back
© 2026 ENATIV
ProjectsServicesKnowledge hubContact
contact@enativ.pl
  1. Knowledge hub
  2. ›
  3. Frontend
  4. ›
  5. Astro

Astro

A framework for content sites: HTML at build time, JavaScript only in islands, content from a CMS.

Frontend

Category
Frontend

In practice

I mostly write in Next.js, but when a site lives on search traffic and mostly shows content, I reach for Astro with Payload CMS. That is how I treat business-card sites, portfolios and blogs. When accounts, bookings or heavy interactivity come in, I go back to Next.js.

What is Astro?

Astro is a framework for content-driven websites. By default it renders every page to HTML and CSS at build time and strips the JavaScript the page does not need. Interactive components are islands: separate pieces that load their code independently of the rest of the page.

A client directive turns a component into an island, for example client:visible, which loads it only in the viewport. React components run through an official integration and, with no directive, reach the browser as plain HTML.

Rendering
Static HTML, on demand through an adapter
JavaScript
Only in islands with a client directive
Content
Content collections with a Zod schema
License
MIT

How I work with Astro

I first ask how much of the site reacts to the visitor. If it is a contact form and a menu, no page needs a whole framework in the browser.

  1. Content from Payload CMS

    Payload runs as a separate app with the editor panel, and Astro reads the REST API that Payload generates from its collections. A content collection with a Zod schema describes the data, so a missing field fails the build, not the visit.

  2. Islands only where needed

    A gallery or a post filter I write in React and mark with client:visible. The rest stays plain HTML, styled with Tailwind CSS, which Astro adds through its official Vite plugin.

  3. Static for as long as possible

    I generate the whole site at build time. When one page must render per request, I add an adapter and turn prerendering off for that page alone. After launch I measure Core Web Vitals on the live site.

When it fits, and when it doesn't

I choose Astro where a site above all has to be found and read.

A good fit when

  • A company business-card site meant to bring clients from Google.
  • A portfolio with a gallery of work.
  • A blog or guides site where an editor publishes from a CMS panel.
  • A landing page where load time on a phone matters.

Not a fit when

  • An app with user accounts, a client panel or bookings.
  • An interface where most of the screen reacts to clicks.
  • A project soon to grow into an app, with one framework wanted for all.
  • A site the owner builds alone in a page builder, with no code.

A site mixing content with app logic is covered under Next.js, and visibility work for any framework sits in technical SEO.

Astro or Next.js?

Both give a search engine ready HTML. They differ in what reaches the browser and how much app logic they assume.

Astro and Next.js compared
CriterionAstroNext.js
JavaScript in the browserNone by default, only in islandsReact runtime on every page
Components.astro files plus React or VueReact, server components by default
Default renderingHTML generated at build timeStatic or per request, in one app
Markdown and MDXMarkdown built in, MDX through an integrationMDX through the @next/mdx package
Application logicActions and on-demand pages through an adapterServer Actions and route handlers built in
Typical projectA content site built for SEOContent combined with application logic

Astro, when the site is there to be read

When a site mostly shows content and lives on search traffic, I take Astro with Payload CMS. Few spots are interactive, so most pages need no JavaScript.

Next.js, when the site has to do things

When accounts, bookings or payments come in, I choose Next.js. The React runtime is needed then anyway, and one framework handles content and logic.

Frequently asked questions

Yes. It can be a React island or a plain HTML form sending data to an Astro action, which validates input with a Zod schema. Submitting through the form action attribute needs that page rendered on demand, so then I add an adapter.
Yes, if the content lives in a CMS. I pair Astro with Payload CMS: the editor works in the panel, the site reads the REST API. On a static site a change appears after a rebuild, so publishing should trigger one.
Both give search engines ready HTML, so indexing is not the difference. JavaScript is: an Astro content page loads none by default, which makes good Core Web Vitals easier. I prepare meta tags and structured data alike in both.
The Astro team joined Cloudflare in January 2026. Cloudflare stated that Astro stays open source under the MIT license, with a public roadmap, deployable to any platform. Official adapters cover Node.js, Netlify, Vercel and Cloudflare, so hosting is not tied to the framework.

On this page

  • In practice
  • What is Astro?
  • How I work with Astro
  • When it fits, and when it doesn't
  • Astro or Next.js?
  • Frequently asked questions

Related topics

  • Astro
  • Next.js
  • Payload CMS
  • React
  • Tailwind CSS
  • Core Web Vitals
  • Structured data (Schema.org)

Related services

  • Web ApplicationsModern, fast and scalable web applications using React and Next.js.
  • Landing PagesHigh-converting landing pages optimized for marketing campaigns.
  • SEO / PositioningTechnical SEO audits, on-page optimization, and monthly reporting to grow organic search traffic sustainably.
  • Performance OptimizationMeasured performance optimization - component-mount profiling and Core Web Vitals audits with a documented before/after result, not a vague promise.
  • Website RedesignRedesign and migration without losing your Google rankings - URL mapping, 301 redirects, and post-launch verification.

A business card, a portfolio or a blog?

Tell me what the site should show and whether it does more than content: a form, accounts, bookings. I will say whether Astro with Payload CMS is enough or Next.js fits better from the start.

Describe your project