--- title: "htmx" description: "htmx gives you access to 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" --- import { getFile } from '../lib/content'; import CDNGenerator from "../components/CDNGenerator.astro"; import EasterEggs from "../components/EasterEggs.astro"; import Sponsors from "../components/Sponsors.astro"; import Hero from "../components/Hero.astro"; import { Image } from 'astro:assets'; import bookCoverHard from '../assets/img/cover.png'; import bookCoverSoft from '../assets/img/cover2.png'; export const sponsorsFile = await getFile('sponsors.yaml'); export const sponsors = (sponsorsFile?.frontmatter || []).map(s => ({ ...s, url: s.tracking !== false ? `${s.url}?utm_source=htmx&utm_medium=sponsorship&utm_campaign=${s.tier}-sponsor-${new Date().getFullYear()}` : s.url, }));
## motivation - Why should only [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) & [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) be able to make HTTP requests? - Why should only [`click`](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) & [`submit`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event) events trigger them? - Why should only [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) & [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) methods be [available](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)? - Why should you only be able to replace the **entire** screen? By removing these constraints, htmx completes HTML as a [hypertext](https://en.wikipedia.org/wiki/Hypertext). ## quick example ```html ``` When clicked, [`hx-post`](/reference/attributes/hx-post) sends a `POST` to `/clicked` and [`hx-swap`](/reference/attributes/hx-swap) replaces the button with the response. No JavaScript. ## book [Hypermedia Systems](https://hypermedia.systems) covers building [Hypermedia-Driven Applications](/essays/hypermedia-driven-applications) with htmx. Free online.
Hypermedia Systems (hardcover) Hypermedia Systems (softcover)
Hypermedia Systems
## sponsors Thank you to all our generous [sponsors](https://github.com/sponsors/bigskysoftware?o=esb)!

htmx is the successor to intercooler.js

ʕ •ᴥ•ʔ made in montana