Pro
Frontend Frameworks · Big Sky Software

HTMX

High-power HTML attributes for hypermedia-driven applications.

BSD · Released 2020 · 48K · Mature
Reviewed today
Stackmaven verdict

HTMX is the anti-SPA framework that grew up. By adding attributes like `hx-get` and `hx-post` to HTML elements, you get server-driven partial-page updates without writing JavaScript. The pitch, "your backend already renders HTML, why ship a SPA?", has resonated hard in Rails, Django, Laravel, and Phoenix communities. 2026 puts HTMX in genuinely production-ready territory. Wrong tool for app-shell SPAs; right tool for CRUD apps, internal tools, and any project where the philosophy of "send HTML, not JSON" actually fits.

Strengths
  • 14KB script tag adds Ajax + partial-page updates via HTML attributes
  • No JavaScript framework required, works with any backend
  • Hypermedia-driven (HATEOAS), server controls the application flow
  • Pairs naturally with Alpine.js for client-side reactive behavior
  • Idiomorph DOM merging for smooth partial-page updates
Trade-offs
  • Wrong tool for highly stateful client-side apps
  • Inline `hx-*` attributes can crowd markup in complex UIs
  • 4.0 still in development as of mid-2026
  • Smaller "framework" ecosystem, most patterns are server-side
  • Hypermedia philosophy doesn't fit every backend or team

HTMX is the small JavaScript library that argues your backend already knows how to render HTML, so why ship a SPA on top? Add hx-get, hx-post, hx-swap to HTML elements and you get Ajax, partial-page updates, and progressive enhancement, without writing a line of JavaScript. Carson Gross’s project has grown from a niche idea into the rallying point for the broader “anti-SPA” movement of 2024–26, particularly inside the Rails, Django, Laravel, and Phoenix communities.

Where it fits

HTMX fits anywhere the constraint is “the backend renders HTML and we need partial-page updates.” The clearest cases are server-rendered CRUD apps, internal tools and admin dashboards, hypermedia-first APIs (HATEOAS in its original sense), and backend stacks adding interactivity without committing to a separate frontend framework.

For app-shell SPAs, Linear-style productivity apps, real-time dashboards, anything with complex client state and offline support, HTMX is the wrong tool. The right framework there is React, Vue, or Svelte. HTMX’s pitch is “you don’t need an SPA” when the use case actually doesn’t need one; pretending otherwise is the failure mode.

Cost to adopt

HTMX is BSD-licensed and free. The cost is conceptual: teams need to internalize hypermedia patterns (HATEOAS, server-driven UI) and restructure how their backend renders partial responses. For Rails or Phoenix teams, this maps cleanly to existing patterns. For teams used to JSON APIs + frontend rendering, the shift requires re-architecting the backend to emit HTML fragments. Once that shift happens, the JavaScript footprint drops dramatically, but the backend gets correspondingly more work.

How it compares

  • Alpine.js, Same anti-SPA philosophy, complementary mechanism. HTMX handles server-driven UI updates; Alpine handles client-side reactive state. They pair naturally and are frequently used together.

  • React, React Server Components close some of the gap (server-rendered UI streamed to the client), but require committing to the React ecosystem. Pick HTMX when you’re already invested in a non-React backend; React for full-stack JavaScript.

  • Svelte, Both ship small JavaScript footprints. Svelte renders a client-side app; HTMX uses the server. Pick Svelte for real apps with small bundles; HTMX for server-driven UIs with even smaller bundles.

  • Vue, Vue is the app framework; HTMX is the hypermedia layer. Pick Vue for SPAs and full-stack apps; HTMX when the backend already renders the page.

What changed recently

HTMX 2.0.9 shipped on April 20, 2026 as the current stable. Carson Gross has declared the 2.x line feature-complete and is now focused on HTMX 4.0 (in development), which adds Fetch API streaming, Idiomorph DOM merging built in, and an hx-status swap selector for HTTP-aware behavior. All extensions moved out of the core repo to their own packages in the 2.0 transition, with independent versioning. The “anti-SPA” movement that HTMX anchors continued accelerating in 2026 as React Server Components, server actions, and partial-page update patterns became mainstream in adjacent ecosystems.

Sources

  1. HTMX releases (GitHub), github.com/bigskysoftware/htmx
  2. HTMX 2.0.0 release announcement, htmx.org, June 2024
  3. HTMX 4.0: Hypermedia finds a new gear, InfoWorld, 2026
  4. HTMX changelog, github.com
esc