Why I use HTMX.
I start with the interaction a person needs. When the server owns the state, returning HTML can keep the interface close to the work.
Consider a service search
A visitor selects an area, searches for a service and reads the results. An ordinary GET form gives that action a URL. HTMX can enhance it by replacing the results region with HTML from the server.
This illustrative fragment shows the relationship. It is an example, not a working search form on this page.
<form action="/services" method="get"
hx-get="/services" hx-target="#results">
<label for="service">Service</label>
<input id="service" name="q">
<button>Search</button>
</form>
<section id="results" aria-live="polite"></section>The server must return a full document for ordinary navigation and a suitable fragment for the enhanced request. The form remains useful when the enhancement is unavailable.
Keep the responsibilities explicit
The server validates inputs and owns the result. The browser presents it. I still need to test focus, loading and error states, history, content security policy and how untrusted text reaches HTML. A small stack still needs careful engineering.
Choose for the interaction
Forms, status changes and operational screens often suit this approach. Rich local state, offline editing or intensive canvas interactions can justify a different architecture. I want the product’s needs to decide which parts belong in the browser.
In my work, that means asking which layer makes the next change easier to understand, test and maintain.