← Software

htmx

A small library for dynamic HTML without a JavaScript framework.

htmx logo

htmx adds attributes to HTML that let any element issue HTTP requests on user interaction and swap returned HTML directly into the DOM. A button with hx-post="/like" and hx-swap="outerHTML" will POST to /like on click and replace itself with the HTML fragment the server returns. The result is interactivity comparable to a single-page app, written in regular server-rendered HTML with no client-side framework.

Carson Gross created htmx in 2020 as a successor to his earlier intercooler.js, drawing on the philosophy that HTML should be extended in the same direction it has always grown — through attributes — rather than replaced wholesale. The library is small (around 14 KB gzipped) and has no required build step.

htmx has gained a substantial following among developers who prefer server-rendered apps with sprinkles of interactivity over full SPA frameworks. It pairs especially well with Django, Flask, Rails, Phoenix, Go's html/template, and other server-side rendering setups, and a growing number of books, talks, and tutorials position it as a credible alternative to React for many CRUD-style applications.

License: BSD-2-Clause OR Zero-Clause BSD

Category: Web

Website: https://htmx.org/

Install

Add to a page:
  <script src="https://unpkg.com/htmx.org@2.0.4"></script>
Or download a release from https://htmx.org/

Authors

  • Carson Gross (creator)
  • htmx contributors
Previoushtmlq Nexthtop

This site is currently in Beta. Contact: Chris Paton

Textbook of AI · Textbook of Usability · Textbook of Digital Health

Auckland Maths and Science Tutoring