htmx

htmx is a small JavaScript library that extends HTML with attributes so that any element can issue network requests and update the page, without writing custom JavaScript. Its documentation defines it as “a library that allows you to access modern browser features directly from HTML, rather than using javascript.” With htmx, a button or div can fetch and swap in server-rendered HTML using attributes like hx-get, hx-post, and hx-target, bringing capabilities that previously required hand-written scripts into plain markup.

The library was created by Carson Gross and is maintained under the Big Sky Software organization on GitHub, where it is described as “high power tools for HTML.” htmx is the successor to Gross’s earlier intercooler.js, carrying the same philosophy into a dependency-free, attribute-driven library. Beyond basic AJAX, it adds support for CSS transitions by preserving element identity across DOM swaps, and it offers extensions for WebSockets and Server-Sent Events, plus the ability to trigger requests on any DOM event rather than only clicks and form submissions.

The deeper idea behind htmx is a return to hypermedia. Gross argues that the original web, where a server sends HTML and links and forms drive navigation, was abandoned too quickly in favor of heavy client-side single-page applications that ship large JavaScript bundles and reimplement the browser’s own machinery. htmx restores the server-rendered model by letting the server respond with HTML fragments that htmx swaps into the page, so application logic and state can live on the server where they began.

This positions htmx against the dominant React-style architecture. Rather than maintaining a client-side virtual DOM and a JSON API consumed by JavaScript, an htmx app sends HTML over the wire and keeps the front end thin. For many interactive needs, such as live search, infinite scroll, inline editing, and form validation, this is enough, and it dramatically reduces the amount of JavaScript a team has to write and maintain.

htmx gained significant attention in the early 2020s as part of a broader reaction against frontend complexity, alongside server-rendered frameworks and the hypermedia revival. It became a practical demonstration that much of the interactivity people reached for SPAs to achieve could be delivered with attributes on HTML backed by a conventional server, an argument Gross and collaborators developed at length in their writing on hypermedia systems.

Sources

Last verified June 8, 2026