mrkeyoor.com_
Fri 16 Oct 19:57 UTC
Webevaluationupdated 27 Aug 2026

htmx review

htmx lets HTML elements send HTTP requests and replace parts of a page through attributes such as `hx-get`, `hx-post`, and `hx-swap`. It is for server-rendered applications that need richer interactions without moving the whole interface and application state into a client framework.

+20stars / 7d
Verdict

Our htmx run installed 575 packages in 35 seconds and passed its tests in 54 seconds, with 0 vulnerabilities reported by npm audit. Use stable htmx 2 for form-heavy, server-rendered products where returning HTML fragments keeps the architecture simpler. Treat htmx 4 as beta software, and choose a client framework when the product's hard problem is durable browser state rather than server interaction.

We ran it

Lab card: what happened when we ran htmxScreenshot of htmx (htmx.org)
Install✓ · 35s575 packages · 185 MB
Buildn/ano build script
Tests✓ · 54sran, no count parsed
Known vulns00 critical · 0 high · 0 moderate · 0 low (npm audit)
Repo635 files~57,378 lines of source · 94.8 MB · 1 CI workflows · tests dir

Answers from our run

Does htmx build from source?

Dependencies installed in 35 seconds (575 packages), and the project has no separate build step. We cloned commit ad56dff into a clean Debian container with 3 CPUs and no project-specific setup.

Do htmx's tests pass?

The test command failed in our container, and its output did not report a pass or fail count.

Does htmx have known vulnerabilities in its dependencies?

npm audit found none in the dependency tree at the time of our run.

Who should not use htmx?

Products whose interface must keep large amounts of offline or cross-screen client state: htmx centers HTTP responses and DOM replacement rather than a client state model.

What are the alternatives to htmx?

Turbo, Unpoly, Alpine.js. Our htmx run installed 575 packages in 35 seconds and passed its tests in 54 seconds, with 0 vulnerabilities reported by npm audit.

Setup4/5One-script app setup; source development installed 575 packages
Docs5/5Clear concepts, reference material, examples, and a hacking guide
Community5/549,021 stars and active issue discussion through August 2026
Maturity4/5Stable 2.x is established, while 4.x remains beta

Discussed on

  1. hnHtmx changes license to Zero-Clause BSD213 points
  2. hnHtmx 2.0.4 Released196 points
  3. hnHtmx: High Power Tools for HTML74 points
  4. hnHtmx become 0 clause BSD-licensed35 points
  5. hnHtmx 2.0 Released15 points

Who it’s for

Backend-led teams that are comfortable returning HTML fragments from routes.
Applications built around forms, tables, filters, search, and partial page updates.
Developers who want AJAX, WebSockets, or server-sent events expressed close to the markup.
Existing server-rendered sites that need selected interactions instead of a client-side rewrite.

Who it’s NOT for

Products whose interface must keep large amounts of offline or cross-screen client state: htmx centers HTTP responses and DOM replacement rather than a client state model.
Teams committed to JSON-only browser APIs: htmx works best when the server can return HTML fragments for swaps.
Developers who expect ignored navigation and update details to disappear: hx-boost, history, targets, swaps, focus, and out-of-band fragments still need explicit browser testing.
Production teams ready to adopt htmx 4 without beta risk: the latest GitHub release is v4.0.0-beta5, and current issues report regressions in trigger headers, custom-element values, and URL handling.
Security teams expecting automatic HTML sanitization on every swap: issue 3616 proposes changing the default toward Element.setHTML(), while current behavior still requires careful control of returned markup.

Setup reality

Our npm sandbox installed 575 packages in 35 seconds and used 185 MB on disk. The repository had no build script or target, so build was skipped. Tests succeeded in 54 seconds, and npm audit reported 0 known vulnerabilities across all severity levels.

Using htmx in an application can be as small as one script tag; source development is heavier because it pulls the documentation and test toolchain. The server must return the right HTML fragment and any HX-* response headers your interaction expects.

The 94.8 MB checkout held 635 files and about 57,378 source lines. It had a tests directory and 1 CI workflow but no Dockerfile. Browser behavior, history, focus, and extensions still need tests in the application that consumes it.

HTML fragments replace a client application layer

htmx adds request and swap behavior to ordinary elements. A button can issue a POST, a form can target one region, and a server response can replace that region without a full navigation. The browser still receives HTML, so templates, validation messages, permissions, and rendering rules can remain on the server. This is attractive when a team already has a productive backend and does not want to duplicate those decisions in a JavaScript application.

The quick-start example needs 2 attributes: hx-post chooses the endpoint and hx-swap chooses how the response replaces the button. Other attributes control triggers, targets, history, indicators, and request values. WebSocket and server-sent-event support lives in extensions. The model is easy to read in markup, but a useful application still needs conventions for fragment routes, error responses, loading states, focus, and browser history.

Server-rendered forms benefit more than offline workspaces

htmx is strongest around interactions that already map cleanly to an HTTP exchange. Search results, pagination, dependent form fields, inline editing, modal content, and table filters can return a focused fragment. The server owns the final markup and can use its normal authorization path. Existing pages can adopt one interaction at a time because links and forms remain understandable HTML rather than becoming components in an all-at-once migration.

A browser-heavy editor, diagrammer, or offline workspace has different needs. Frequent local state changes do not naturally belong in round trips that return HTML. Client-side state shared across distant regions can also make swap ownership hard to follow. Alpine.js or a larger client framework may sit beside htmx, but each addition creates another state boundary. If most product logic already lives in the browser, using htmx for transport may make the architecture harder to explain.

What happened when we ran it

Our sandbox cloned commit ad56dff and installed 575 npm packages in 35 seconds. The installed dependency tree used 185 MB. There was no build script or target, so the harness skipped that step rather than inventing one. The test command succeeded in 54 seconds, and npm audit reported 0 known vulnerabilities: 0 critical, 0 high, 0 moderate, and 0 low.

The source checkout was 94.8 MB, with 635 files and about 57,378 lines. It contained a tests directory and 1 CI workflow, but no Dockerfile. Most application users will consume the small distributed browser script instead of this development tree. Contributors, however, need the larger npm toolchain and a local web server because the README's hacking guide runs the browser suite from /test/.

Our run establishes that the supplied test command completed on the measured commit. It did not verify an application's backend fragments, Content Security Policy, keyboard flow, focus restoration, history behavior, or extension mix. Those failures emerge from the contract between markup and server responses. Test representative clicks with JavaScript enabled, then confirm the underlying links and forms still provide an acceptable path where progressive enhancement is part of the promise.

Version 4 is still a beta with active regressions

The latest GitHub release is v4.0.0-beta5, published June 26, 2026, while the README quick start currently points to htmx 2.0.10. That split matters. Teams starting a production project should not treat the newest GitHub tag as an automatic upgrade target. Pin the line selected, read its migration material, and keep browser tests around every custom event, history update, out-of-band swap, and extension.

Recent reports give concrete tests for version 4. Issue 3972 says an HX-Trigger response stopped activating an element listening for that label. Issue 3871 reports that a standalone form-associated custom element lost its submitted value beginning in beta4 and remained broken in beta5. Issue 3966 says hx-push-url="false" was ignored for boosted anchors. These reports are scoped, reproducible reasons to hold an upgrade when an application uses those paths.

Returned HTML keeps security on the server's critical path

A fragment response can contain markup that htmx inserts into the document. That makes output escaping and trusted template boundaries central to the security model. Issue 3616 proposes a swap based on Element.setHTML() and suggests changing the default away from innerHTML as browsers add a sanitizing API. The proposal is not current behavior. Applications should assume that unsafe server output can become unsafe page content and keep untrusted strings inside escaped template contexts.

The same server ownership is also a benefit. Authorization does not need to trust a browser state store, and validation can return the exact form region that failed. A 422 response, an authentication redirect, or a stale fragment still needs an intentional target and status policy. Test error responses directly because a successful 200 demo says little about expired sessions, conflicting edits, or a removed triggering element.

Fresh activity supports stable htmx 2, not blind upgrades

GitHub showed 49,021 stars, 678 combined issues and pull requests, and a last push on August 27, 2026. That count includes pull requests and should not be read as 678 bugs. Current discussions cover both the stable 2.x line and the 4.x beta, which helps explain the volume. Release recency and detailed issue follow-up show an active project, while the beta reports show that activity is still changing behavior.

htmx is an excellent fit when the server can answer interactions with HTML and the team values one rendering system. Our 35-second install and successful 54-second test run make the source easy to evaluate, even though the contributor tree carries 575 packages. Start with a bounded form or table, measure how many special swap rules it needs, and stop if client state begins driving the design. That boundary is clearer than any argument about JavaScript size.

Alternatives

ProjectWhat it isPick it when
TurboHTML-over-the-wire navigation and partial updates from the Hotwire project.pick this instead when frame navigation, streams, and the Rails-oriented Hotwire model fit the application.
UnpolyA server-rendered web framework for fragment updates, layers, and progressive enhancement.pick this instead when built-in layers and a more opinionated navigation model are useful.
Alpine.js gh↗A small client-side reactive layer written directly in HTML attributes.pick this instead when local browser state and DOM behavior matter more than server-returned fragments.

What people are saying

  1. [hackernews] Let's make the worst Htmx
  2. [lobsters] Building Progressively Enhanced Forms Using htmx

Sources

  1. htmx repository and README
  2. htmx v4.0.0-beta5 release
  3. HTMX 4 trigger header issue 3972
  4. HTMX 4 custom element regression 3871
  5. Element.setHTML swap proposal 3616

More web reviews

dioramas · elpis · deepseek-whale-girl · floorplan-3d · taro · driver.js · the whole board →