htmx gives you access to AJAX, CSS Transitions, WebSockets, and Server-Sent Events directly in HTML — no JavaScript needed.
What You Get for Free
- AJAX from HTML — hx-get, hx-post, hx-put, hx-delete
- Partial page updates — swap inner/outer HTML
- No build step — just a script tag
- 14KB — tiny, zero dependencies
- Any backend — works with Django, Rails, Go, PHP
- WebSockets + SSE — real-time from HTML attributes
Add to Any Page
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
Dynamic Search
<input type="search" name="q"
hx-get="/search"
hx-trigger="keyup changed delay:300ms"
hx-target="#results" />
<div id="results"></div>
The server returns HTML — htmx swaps it into #results. No JSON. No client-side rendering.
htmx vs React
| Feature | htmx | React |
|---|---|---|
| Size | 14KB | 140KB+ |
| Approach | Server-rendered | Client-rendered |
| Build step | None | Required |
| Learning curve | HTML | JSX + hooks + state |
Need web development? Check my work on GitHub or email spinov001@gmail.com for consulting.
Top comments (0)