<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/htmx-mlto71ou4" -->

---
title: HTMX | daily.dev
description: HTMX is a small library that lets HTML attributes trigger HTTP requests and update parts of a page with the server's response. It provides access to AJAX, CSS...
canonical: https://daily.dev/posts/htmx-mlto71ou4
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: HTMX | daily.dev
og:description: HTMX is a small library that lets HTML attributes trigger HTTP requests and update parts of a page with the server's response. It provides access to AJAX, CSS...
og:url: https://daily.dev/posts/htmx-mlto71ou4
og:image: https://api.daily.dev/og/posts/mltO71oU4.png
og:image:alt: HTMX
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HTMX

**[Wawandco](https://daily.dev/sources/wawandco)** · 4 min read · 0 upvotes · 0 comments

## Summary

HTMX is a small library that lets HTML attributes trigger HTTP requests and update parts of a page with the server's response. It provides access to AJAX, CSS transitions, WebSockets and Server-Sent Events directly in HTML, using attributes, succeeding an earlier library called intercooler.js. A button can use 'hx-post' and 'hx-swap' attributes to send a POST request and swap in the returned HTML. The server returns HTML rather than JSON, keeping rendering logic on the server.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://wawand.co/resources/glossary/htmx>

## Questions this post answers

### What does the hx-post and hx-swap attribute combination do in HTMX?

Adding hx-post='/clicked' and hx-swap='outerHTML' to a button tells HTMX to send a POST request to '/clicked' when the button is clicked, then replace the entire button element with the HTML returned by the server. This lets a single button declare both the request and how the response updates the page without any hand-written JavaScript.

_Building interactive pages without a JS framework? daily.dev surfaces HTMX patterns like this as they come up._

### What are the main trade-offs of using HTMX instead of a client-side framework like React?

HTMX relies on server round trips for most interactions, so slow connections or server delays become noticeable, unlike client-rendered apps. It also requires deciding how HTML fragments are structured and returned, and teams used to client-side frameworks may need time to adjust. Interfaces needing heavy local state or offline support may fit better with a client-side framework instead.

_Weighing HTMX against React or Vue for a new project? daily.dev tracks comparisons like this for developers deciding on a stack._

### What was HTMX called before it was renamed, and what is its design philosophy?

HTMX's predecessor was a library called intercooler.js. HTMX is built around a hypermedia-driven model where the server sends HTML that already contains the next possible actions, with its authors describing the goal as building interfaces with 'the simplicity and power of hypertext,' removing HTML's original limits on which elements, events, and methods can trigger requests.

_Curious about hypermedia-driven architecture? daily.dev follows library histories and design philosophies like HTMX's for developers learning the model._

## Similar posts on daily.dev

- [Please Just Fucking Try HTMX](https://daily.dev/posts/please-just-fucking-try-htmx-ncu8zbk1v) · Lobsters · 21 upvotes · 3 comments
- [A deep dive into HTMX](https://daily.dev/posts/a-deep-dive-into-htmx-uuhadafnq) · Flavio Copes · 1 upvotes · 0 comments
- [HTMX Is So Cool I Rolled My Own\!](https://daily.dev/posts/htmx-is-so-cool-i-rolled-my-own--ocvhcvgx1) · Lobsters · 28 upvotes · 4 comments
- [HTMX 4.0: Hypermedia finds a new gear](https://daily.dev/posts/htmx-4-0-hypermedia-finds-a-new-gear-swv18ajzs) · InfoWorld · 119 upvotes · 4 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript), [#golang](https://daily.dev/tags/golang), [#htmx](https://daily.dev/tags/htmx)

[View this post on daily.dev](https://daily.dev/posts/htmx-mlto71ou4)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"HTMX","url":"https://daily.dev/posts/htmx-mlto71ou4","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/htmx-mlto71ou4"},"datePublished":"2026-10-27T09:46:30.494Z","dateModified":"2026-10-27T09:46:59.096Z","description":"HTMX is a small library that lets HTML attributes trigger HTTP requests and update parts of a page with the server's response. It provides access to AJAX, CSS...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9cdbc67858c4b9a0642ea210acc1e13c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9cdbc67858c4b9a0642ea210acc1e13c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Wawandco","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Wawandco","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6fd59b4ffa57474a8d77c28a4d7deadb","url":"https://daily.dev/sources/wawandco"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/htmx-mlto71ou4","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,javascript,golang,htmx","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Wawandco","item":"https://daily.dev/sources/wawandco"},{"@type":"ListItem","position":3,"name":"HTMX"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/htmx-mlto71ou4#faq","mainEntity":[{"@type":"Question","name":"What does the hx-post and hx-swap attribute combination do in HTMX?","acceptedAnswer":{"@type":"Answer","text":"Adding hx-post='/clicked' and hx-swap='outerHTML' to a button tells HTMX to send a POST request to '/clicked' when the button is clicked, then replace the entire button element with the HTML returned by the server. This lets a single button declare both the request and how the response updates the page without any hand-written JavaScript. Building interactive pages without a JS framework? daily.dev surfaces HTMX patterns like this as they come up."}},{"@type":"Question","name":"What are the main trade-offs of using HTMX instead of a client-side framework like React?","acceptedAnswer":{"@type":"Answer","text":"HTMX relies on server round trips for most interactions, so slow connections or server delays become noticeable, unlike client-rendered apps. It also requires deciding how HTML fragments are structured and returned, and teams used to client-side frameworks may need time to adjust. Interfaces needing heavy local state or offline support may fit better with a client-side framework instead. Weighing HTMX against React or Vue for a new project? daily.dev tracks comparisons like this for developers deciding on a stack."}},{"@type":"Question","name":"What was HTMX called before it was renamed, and what is its design philosophy?","acceptedAnswer":{"@type":"Answer","text":"HTMX's predecessor was a library called intercooler.js. HTMX is built around a hypermedia-driven model where the server sends HTML that already contains the next possible actions, with its authors describing the goal as building interfaces with 'the simplicity and power of hypertext,' removing HTML's original limits on which elements, events, and methods can trigger requests. Curious about hypermedia-driven architecture? daily.dev follows library histories and design philosophies like HTMX's for developers learning the model."}}]}
```

