Networking
hx-sseStream updates via Server-Sent Events (SSE) | Stream updates via Server-Sent Events (SSE) |
hx-wsEnable bidirectional connections over WebSockets (WS) | Enable bidirectional connections over WebSockets (WS) |
Performance
hx-preloadPreload content on hover for instant page loads | Preload content on hover for instant page loads |
hx-ptagSkip swaps when polled content hasn't changed | Skip swaps when polled content hasn't changed |
hx-history-cacheCache pages in sessionStorage for instant back/forward | Cache pages in sessionStorage for instant back/forward |
UX
hx-optimisticApply optimistic UI updates before the server responds | Apply optimistic UI updates before the server responds |
hx-downloadSave responses as file downloads with progress events | Save responses as file downloads with progress events |
hx-browser-indicatorShow the browser's native loading indicator | Show the browser's native loading indicator |
hx-liveAdd lightweight reactivity backed by the DOM | Add lightweight reactivity backed by the DOM |
hx-promptPrompt before a request, send the answer as a header | Prompt before a request, send the answer as a header |
Swap behaviors
hx-headMerge head tags (styles, scripts) into htmx responses | Merge head tags (styles, scripts) into htmx responses |
hx-upsertUpdate or insert elements by ID for dynamic lists | Update or insert elements by ID for dynamic lists |
hx-targetsSwap one response into multiple elements at once | Swap one response into multiple elements at once |
Compatibility
htmx-2-compatRestore htmx 2.x defaults and event names on htmx 4 | Restore htmx 2.x defaults and event names on htmx 4 |
hx-alpine-compatRun htmx alongside Alpine.js without conflicts | Run htmx alongside Alpine.js without conflicts |
Security
hx-cspMake htmx work under strict Content Security Policy | Make htmx work under strict Content Security Policy |