DEV Community

Cover image for Headless CMS Frontend Frameworks
Kevinleary.net
Kevinleary.net

Posted on Originally published at kevinleary.net

Headless CMS Frontend Frameworks

If you want to pick a frontend framework for a headless CMS website, this covers the SPA and MPA options I'd consider and when each one fits.

Headless CMS frontend frameworks comparison

Download the one-page framework comparison (PDF)

On a traditional CMS like standard WordPress or Drupal, the frontend is mostly a skin. The CMS owns URL routing, database queries, HTML assembly and page delivery out of the box, and developers style theme templates and add some JavaScript on top.

When you go headless, the backend steps back and becomes a content repository and an API. The frontend takes over everything the public sees:

  • URL routing and slug resolution: mapping thousands of editorial paths, nested categories and localized URLs to the right content.
  • Rendering and caching: deciding whether HTML is compiled at build time, rendered on an origin server or assembled in milliseconds at the network edge.
  • Editorial live previews: rendering unpublished draft JSON in real time so editors can see layout changes before they publish.
  • Search, accessibility and performance: semantic HTML, structured schema for SEO and AEO, WCAG compliance and Core Web Vitals.

A headless CMS delivers standard JSON over REST or GraphQL, so you can pair any backend (WordPress VIP, Sanity, Contentful, Storyblok, Craft or Shopify) with almost any frontend. Most teams default to a heavy single-page application framework like Next.js out of habit, even on content websites that suffer under the JavaScript. Every serious option falls into one of two camps: SPA (hybrid single-page application) frameworks and MPA (multi-page application) architectures.

SPA vs. MPA

Before comparing frameworks, it helps to understand what happens in the browser when a visitor reads an article and clicks a link to the next page.

How SPA & Hybrid Frameworks Work

Pure client-rendered SPAs, the kind that shipped an empty <div> and broke SEO, are mostly gone from the CMS world. They've been replaced by hybrid SSR frameworks like Next.js, Nuxt and SvelteKit.

  • First page load: the server or CDN delivers complete, crawlable HTML for the URL, followed by a JavaScript runtime bundle that "hydrates" the page in the browser to make it interactive.
  • Every click after that: the framework's JavaScript router intercepts clicks on internal links. Instead of loading a new HTML document, it fetches a JSON or component payload for the next slug, swaps the page contents in memory and updates the address bar with the History API.

Strengths:

  • State persists across page navigations. That's essential for continuous audio or video players, live shopping carts and authenticated dashboards that sit alongside editorial content.
  • Page transitions are instant once the JavaScript has loaded and prefetched nearby links.
  • Huge third-party component ecosystems for SaaS widgets, auth providers and analytics wrappers.

Weaknesses:

  • The hydration tax: every visitor's phone has to download, parse and execute a lot of framework JavaScript just to read text on a page. That often hurts Interaction to Next Paint (INP) and Time to Interactive.
  • Duplicated complexity: routing, state management, auth checks and analytics tracking have to stay in sync between the server and client-side route transitions. This is where the memory leaks and misfired ad and analytics tags on long reading sessions come from.
  • Infrastructure overhead: it often pushes teams toward expensive serverless compute and complicated ISR or pull cache invalidation.

How MPAs Work

An MPA works the way the web was designed to work. Every URL is a standalone HTML document, and no JavaScript router hijacks link clicks.

  • Every page load: clicking an <a> link is a normal browser navigation to a fresh HTML document, served statically from a CDN or rendered in single-digit milliseconds by an edge worker. JavaScript only loads on the pages or widgets that need it.
  • App-like polish without the bloat: teams used to choose SPAs because full page reloads caused a white flash between pages. Browsers have solved that natively. Two lines of CSS (@view-transition { navigation: auto; }) plus the Speculation Rules API (<script type="speculationrules">) tell the browser to prefetch the next page on link hover and cross-fade between pages at 60fps. You get SPA smoothness with 0 KB of client routing JavaScript.

Strengths:

  • Performance and Core Web Vitals: no hydration and very little JavaScript, so pages load and respond instantly, even on throttled mobile networks.
  • Reliable analytics, ads and accessibility: every page view is a clean browser lifecycle. Screen readers reset focus naturally, ad slots refresh without DOM ghosts, and analytics scripts work out of the box.
  • Lean at the edge: pairs well with an event-driven push cache architecture on Cloudflare Workers, which keeps hosting costs tiny even at very high traffic.

Weaknesses:

  • Keeping continuous client-side UI state across page loads, like an uninterrupted podcast player or a multi-step app workspace, takes deliberate workarounds or hybrid islands.

SPA & Hybrid Framework Options

When your website behaves like a stateful web application, mixing editorial publishing with logged-in user portals, interactive tools or ecommerce, these three lead the headless ecosystem.

Next.js (React)

Next.js is the default in the enterprise headless CMS market, and it's the first thing roughly 80% of engineering teams ask for. Every major headless CMS builds its flagship SDKs, visual live preview overlays and starter kits for Next.js first.

  • Routing: file-system routing (app/[slug]/page.tsx) with React Server Components, server-side rendering, static generation and client-side link prefetching.
  • Where it works well: organizations with large internal React teams, heavy reliance on turnkey enterprise SaaS SDKs, and hybrid websites that blend marketing pages with authenticated customer applications.
  • The catch: heavy client-side JavaScript bundles, fast API churn between versions, complicated caching behavior and optimizations that often nudge self-hosted enterprise teams toward pricey Vercel infrastructure.

Nuxt (Vue)

Nuxt is the strongest number two, and it's especially popular with visual-heavy marketing organizations and European enterprises.

  • Routing: file-based routing (pages/[...slug].vue) backed by Vue Router on the client and the Nitro server engine underneath.
  • Where it works well: pairing with visual-first headless CMS platforms like Storyblok (which grew up tightly integrated with Vue) or Directus. Nitro also compiles cleanly to Cloudflare Workers, AWS Lambda or Node containers without vendor lock-in.
  • The catch: it still carries virtual DOM hydration overhead on pure content pages, and there are fewer of the React-only enterprise third-party wrappers available in the US market.

SvelteKit (Svelte)

SvelteKit is consistently the performance and developer experience favorite among senior frontend engineers. Instead of shipping a heavy virtual DOM runtime like React or Vue, Svelte is a compiler. It turns components into small, targeted vanilla JavaScript updates at build time.

  • Routing: file-based routing (src/routes/[slug]/+page.svelte) built around standard HTML <a> tags and the native web Request and Response APIs.
  • Where it works well: high-traffic media brands, interactive data journalism (The New York Times uses Svelte extensively for interactive storytelling and live election graphics) and lean deployments on Cloudflare Workers where CPU and bundle limits matter.
  • The catch: fewer plug-and-play SDKs from legacy enterprise vendors, so developers occasionally write vanilla JS integrations. It also has a great hidden feature: setting export const csr = false turns any route into a pure zero-JS MPA.

MPA Options for Headless CMS

When the website's main job is publishing content, ranking in search and AI engines, converting visitors and surviving traffic spikes without a shocking cloud bill, skipping the SPA is often the smarter move.

Astro

Astro was built for content-driven headless websites, and it's now a mainstream enterprise choice. Developers get modern component ergonomics (TypeScript, scoped styles, official Sanity, Contentful, Storyblok and WordPress SDKs), and the output compiles down to pure HTML and CSS with 0 KB of client JavaScript by default.

  • Routing: file-based routing (src/pages/articles/[slug].astro) with both static build output and on-demand edge SSR, including first-class support for the Cloudflare Workers runtime.
  • Islands architecture: when a page needs rich interactivity, like a pricing slider, search modal or chart, you mount an isolated React, Vue or Svelte component inside Astro (client:visible). Only that island loads JavaScript. The other 95% of the page stays pure HTML.

Edge-Rendered JSX (Hono + Cloudflare Workers)

For high-scale publishers running an event-driven push cache, pairing a micro-router like Hono (about 14 KB, built on web standards) with Cloudflare Workers removes the build step bottleneck entirely.

  • Routing: explicit, fast URL pattern matching (app.get('/articles/:slug', ...)) running across 300+ edge locations in under 15ms.
  • How it works: developers write familiar, type-safe JSX templates on the server, pull normalized CMS JSON straight from Cloudflare KV or R2, and stream semantic HTML to the browser. No React runtime is ever sent to the client.

HTML Over the Wire (HTMX & Alpine AJAX)

A lot of teams assume they need React and Next.js because the website has faceted search, category filtering or "Load More" pagination across 20,000 CMS entries. HTMX (about 14 KB) removes that false choice.

  • Routing and interactivity: standard server or edge routes deliver full HTML pages. When a visitor clicks a topic filter or types in a search bar, HTMX (hx-get="/partials/posts?tag=security") fetches a pre-rendered HTML fragment from an edge endpoint and swaps that single <div> into the page. You get SPA-like interactivity without client-side JSON parsing, GraphQL caches or duplicated state.

Static Site Generators (Eleventy & Hugo)

For large documentation hubs, research archives or websites where content doesn't need per-request personalization, classic static site generators have held up remarkably well.

  • Routing: build scripts loop over the headless CMS API and generate a directory tree of static .html files (/topic/post-slug/index.html) served from any CDN or object storage bucket.
  • Where it works well: Hugo (written in Go) can compile 50,000+ CMS pages in seconds, and Eleventy (11ty) is about as simple as Node gets, with no client boilerplate. The main tradeoff is wiring up separate edge preview routes so editors don't wait on a static build to preview drafts.

Pure HTML, CSS & Vanilla JavaScript

The most overlooked option, and the one that lasts the longest, is skipping frontend frameworks altogether: semantic HTML5, modern CSS (Grid, custom properties, native nesting, @view-transition), vanilla ES modules or Web Components, and a clean edge router.

  • Routing: static folder output, or a lightweight Cloudflare Worker using the native URLPattern API to inject CMS data into HTML template literals.
  • Where it works well: organizations that care most about raw speed, security and 10 years of maintenance without churn. A Next.js codebase from three years ago often needs a painful multi-week framework upgrade just to stay supported. Pure HTML, CSS and standard JavaScript never deprecate, never break from an npm dependency cascade, and run as fast as the browser can go.

Framework Comparison

Frontend Architecture Client JS Best For
Next.js (React) Hybrid SPA High App-heavy portals, authenticated dashboards, deep SaaS SDK reliance
Nuxt (Vue) Hybrid SPA Moderate to high Visual-first marketing websites (Storyblok), multi-cloud edge flexibility
SvelteKit Hybrid SPA (or MPA) Very low (compiled) Interactive journalism, rich data viz, fast custom apps
Astro MPA + islands Zero by default (opt-in) Content and marketing platforms that need modern components and top Core Web Vitals
Hono (edge JSX) Edge MPA Zero High-volume publishers running Cloudflare Worker push cache pipelines
HTMX + edge Hypermedia MPA Tiny (about 14 KB) Content directories, dynamic filtering and search without SPA complexity
Pure HTML/CSS/JS Native web MPA Zero (custom only) Maximum speed, no dependency rot, long-term maintainability

Don't Choose a Framework Out of Hiring Fear

When I talk with CTOs and VPs of Engineering, the number one reason a bloated React SPA ends up on a content website isn't technical. It's anxiety about hiring: "We're choosing Next.js because it's easiest to hire React developers."

Building your platform's speed, cloud budget and long-term maintenance around the most common resume keyword is backwards, for two reasons:

  1. Strong engineers know the fundamentals, not just one library. Any senior frontend or full-stack engineer understands HTTP caching, DOM semantics, TypeScript, state flow and web standards. A competent React developer doesn't need six months to learn Astro, SvelteKit, Nuxt or Hono JSX. They're productive in an afternoon and fluent within a week. Hiring framework specialists who can't work outside React usually selects for weaker fundamentals anyway.
  2. AI coding tools have removed framework lock-in. With Claude Code, OpenAI Codex and repository-aware coding agents built into development and PR workflows, framework syntax differences are a solved problem. Translating component idioms, writing idiomatic Svelte runes or Astro templates, scaffolding Hono edge routes, or moving a React team onto a leaner MPA codebase happens quickly with AI pair programming and automated PR reviews. It's never been harder to get cornered by choosing a leaner, non-React stack.

Choose the best tool for what you're actually building. If it's a stateful customer portal that happens to have a blog attached, use Next.js, Nuxt or SvelteKit. If it's an editorial publication, media platform or enterprise marketing website where speed, SEO and AEO visibility and lean infrastructure matter most, leave the SPA overhead behind and build an MPA with Astro, edge JSX or plain web standards.

Top comments (0)