htmx lets you build modern, dynamic web interfaces using HTML attributes instead of JavaScript frameworks. No React, no Vue, no build step.
What Is htmx?
htmx extends HTML with attributes for AJAX, CSS transitions, WebSockets, and Server-Sent Events — directly in your markup.
<!-- Load content from server on click -->
<button hx-get="/api/data" hx-target="#result">Load Data</button>
<div id="result"></div>
<!-- Submit form without page reload -->
<form hx-post="/api/submit" hx-swap="outerHTML">
<input name="email" type="email" placeholder="Your email">
<button type="submit">Subscribe</button>
</form>
<!-- Infinite scroll -->
<div hx-get="/api/items?page=2" hx-trigger="revealed" hx-swap="afterend">
Loading more...
</div>
<!-- Live search -->
<input type="search"
hx-get="/api/search"
hx-trigger="keyup changed delay:300ms"
hx-target="#results">
Add one script tag:
<script src="https://unpkg.com/htmx.org@2.0"></script>
Features: AJAX via HTML attributes, any backend language works, no build step, 14KB gzipped, progressive enhancement.
With 42K+ GitHub stars. HTML-first interactivity.
Top comments (0)