htmx
Installation
SKILL.md
htmx: hypermedia-driven UIs
The server owns all application state and renders HTML. The client is dumb: it swaps server-rendered fragments into the DOM. There is no JSON API for the UI, no client store, no virtual DOM, no client router. If you find yourself returning JSON and rendering it with JavaScript, you have stopped doing htmx and started building an SPA — use a different tool.
The unit of work is one request, described by four attributes on one element:
- a verb —
hx-get/hx-post/hx-put/hx-patch/hx-delete(the URL) hx-target— which DOM node receives the response (CSS selector orthis)hx-swap— how the response is placed (defaultinnerHTML)hx-trigger— on what event (default: natural —clickfor buttons,submitfor forms,changefor inputs)
Versions (verify before pinning). htmx 2.0.x is current stable (2.0.10 latest 2.x line); v1 (1.9.x) is legacy, kept only for IE/old-browser support. htmx v4 is in beta targeting Summer 2026 and changes some defaults (default swap behavior, config) — do not write to v4 yet. Pin to 2.x: