</> htmx - high power tools for HTML

★ 49,623⑂ 1,814👁 212⑃ 1,883● 1,838▤ 37◈ 410
JavaScriptNOASSERTIONCreated 2020-04-13htmx.org
49,623
stars
+4
1,814
forks
212
watchers
1,883
prs
1,838
issues
37
releases
410
discussions

README

high power tools for HTML






 introduction

htmx allows you to access  AJAX, CSS Transitions,
WebSockets and Server Sent Events
directly in HTML, using attributes, so you can build
modern user interfaces with the simplicity and
power of hypertext

htmx is small (~14k min.gz'd),
dependency-free &
extendable

 motivation

 Why should only  and  be able to make HTTP requests?
 Why should only click & submit events trigger them?
 Why should only GET & POST be available?
 Why should you only be able to replace the entire screen?

By removing these arbitrary constraints htmx completes HTML as a
hypertext

 quick start

html
  
  
  
    Click Me
  


The hx-post and hx-swap attributes tell htmx:

 "When a user clicks on this button, issue an AJAX request to /clicked, and replace the entire button with the response"

htmx is the successor to intercooler.js

 installing as a node package

To install using npm:


npm install htmx.org --save


Note there is an old broken package called htmx.  This is htmx.org.

 website & docs

 
 

 contributing
Want to contribute? Check out our contribution guidelines

No time? Then become a sponsor

 hacking guide

To develop htmx locally, you will need to install the development dependencies.

Run:


npm install


Then, run a web server in the root.

This is easiest with:


npx serve


You can then run the test suite by navigating to:



At this point you can modify /src/htmx.js to add features, and then add tests in the appropriate area under /test.

 /test/index.html - the root test page from which all other tests are included
 /test/attributes - attribute specific tests
 /test/core - core functionality tests
 /test/core/regressions.js - regression tests
 /test/ext - extension tests
 /test/manual - manual tests that cannot be automated

htmx uses the mocha testing framework, the chai assertion framework
and sinon to mock out AJAX requests.  They are all OK.

 haiku

javascript fatigue:
longing for a hypertext
already in hand

Top issues

Discussions

Latest release

v4.0.1 v4.0.1 2026-11-01
v4.0.1

 Any trigger now cancels a pending delay or throttle trigger on the same element, as in 2.x
 Fixed an older response overwriting a newer one with hx-sync replace (4028)
 Fixed a response with only hx-partial blanking the body, and ignoreTitle support in hx-partial
 Improved history back and forward reliability, and fixed the hx-history-cache POST stamp (4067)
 hx-trigger now works on boosted elements (4127)
 every 2s [cond] now honors its filter (4133)
 Fixed the changed modifier on forms and multiple changed triggers on one element (4035, 4096)
 scrollTarget and showTarget now work wi

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON