htmx

JavaScript library that gives HTML the power of Ajax without writing JavaScript. htmx extends HTML with attributes (hx-get, hx-post, hx-trigger, hx-swap) that enable partial page updates by swapping HTML fragments returned from the server. Enables agent admin UIs and dashboards to be built with server-rendered HTML without a full JavaScript SPA framework.

Evaluated Mar 06, 2026 (0d ago) v1.9+/2.0+
Homepage ↗ Repo ↗ Developer Tools html ajax hypermedia javascript sse websocket hateoas progressive-enhancement
⚙ Agent Friendliness
67
/ 100
Can an agent use this?
🔒 Security
89
/ 100
Is it safe for agents?
⚡ Reliability
88
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
90
Error Messages
78
Auth Simplicity
95
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
85
Scope Granularity
82
Dep. Hygiene
90
Secret Handling
90

XSS risk when server renders user-provided content into HTML — sanitize all user inputs server-side. CSRF must be configured. No server-side security concerns from HTMX itself.

⚡ Reliability

Uptime/SLA
100
Version Stability
88
Breaking Changes
85
Error Recovery
80
AF Security Reliability

Best When

You want to build dynamic web UIs for agent backends using server-side rendering without a frontend build pipeline or SPA complexity.

Avoid When

You need complex client-side state management, offline support, or a mobile app — use a full frontend framework.

Use Cases

  • Build agent admin dashboards with server-side rendering and dynamic updates without React/Vue complexity
  • Create agent monitoring UIs where live data updates arrive via SSE and swap into HTML fragments
  • Implement search-as-you-type and live filtering in agent tools using HTMX's trigger system
  • Build FastAPI + Jinja2 + HTMX agent backends with progressive enhancement without JavaScript bundlers
  • Create form submissions in agent configuration UIs that return updated HTML partials without page reload

Not For

  • Complex interactive SPAs — React, Vue, or Svelte provide better component models for complex client-side logic
  • Real-time collaborative features — htmx's SSE support is basic; use Socket.io for bidirectional real-time
  • Mobile apps — htmx is web-only

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Client-side library — auth handled server-side. HTMX adds headers (HX-Request, HX-Current-URL) that servers can use for auth checks.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Completely free and open source.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • HTMX relies on server-returned HTML — the server must return HTML fragments, not JSON; requires server-side templating (Jinja2, Go templates, etc.)
  • CSRF protection: HTMX sends requests that can be mistaken for AJAX by CSRF middleware — must configure CSRF middleware to accept HTMX headers
  • hx-boost makes links and forms AJAX by default — can break pages that expect full navigation (authentication redirects, file downloads)
  • Out-of-band swaps (hx-swap-oob) update multiple page regions — requires careful HTML structure and can cause confusing render behavior if misused
  • HTMX 2.0 changed default behavior for some attributes vs 1.x — check migration guide when upgrading from 1.x
  • History management: hx-push-url adds to browser history but browser back button fetches a full page — server must handle full page loads for any URL that HTMX navigates to

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for htmx.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered