htmx 2.0.10 is the stable baseline in May 2026. Build a modern hypermedia app with boosted nav, OOB swaps, and server-first patterns. Read now.

Start from the server, not the client bundle

Hypermedia systems treat HTML as the application protocol, not a thin shell for a client-side state machine. With htmx 2.0.10 as the stable baseline, you keep routing, authorization, and data assembly on the server and return HTML fragments that update the page in place. That does not mean you abandon interactivity. It means you choose when the browser needs more than a partial response—local validation, optimistic UI, or a small widget—and keep everything else as requests that return markup the server already knows how to render.

Server-first patterns reduce the amount of duplicated domain logic between a JSON API and a separate SPA. The same handlers that render full pages can return partials for swaps. Forms stay ordinary HTML with progressive enhancement: they work without JavaScript, and htmx layers request headers, targets, and swap strategies on top when scripts load. Design endpoints around user actions and page regions, not around client store shapes that change every sprint.

Boosted navigation for multi-page feel with partial updates

Boosted navigation turns standard links and forms into AJAX-driven transitions while preserving real URLs and browser history. Instead of rewriting every anchor into a client router, you boost the document or specific containers so clicks fetch HTML and swap content into a chosen target. Users still see distinct pages in the address bar; crawlers and assistive tools still see normal links. You avoid the cost of shipping a full client router for mostly server-driven flows.

Use boosting where the shell stays stable—nav, chrome, layout—and only the main region changes. Keep non-boosted paths for full reloads when the layout, auth boundary, or asset set truly differs. Pair boosts with clear loading indicators and focus management so keyboard and screen-reader users know what changed. Treat the server response as the source of truth for the next view: if the action fails, return error markup or a redirect status the client can follow rather than inventing a parallel error model in JavaScript.

Out-of-band swaps for multi-region updates

Out-of-band (OOB) swaps let a single response update more than one part of the page. A form submit can replace the form body, refresh a sidebar count, and show a toast region without a second round trip or a hand-rolled event bus. Mark secondary fragments in the response so htmx places them into existing elements by id. That keeps multi-widget consistency on the server: one request, one coherent HTML result, several visible regions updated together.

OOB is most useful when related UI must stay in sync after a mutation—cart totals, flash messages, open-task badges. Avoid scattering OOB fragments for unrelated widgets; prefer one well-scoped response over a grab bag of partials. Name targets explicitly, keep ids stable, and document which endpoints may emit OOB so templates do not silently depend on side effects. When a region does not exist on the current page, omit that fragment instead of inventing client-side create-or-update logic.

Practical structure for a hypermedia app

  • Define page shells and named swap targets early (main, status, modals).
  • Return full documents for first load and fragments for subsequent interactions.
  • Use boosted nav for in-shell movement; reserve full navigations for hard boundaries.
  • Prefer OOB for correlated multi-region updates after writes.
  • Add small client scripts only where the server cannot express the interaction cleanly.

Modern web apps with htmx succeed when you optimize for readable request/response loops and durable HTML contracts. Measure complexity by how many places encode the same business rule, not by how close the stack looks to a SPA. Start with server-rendered flows, boost navigation where the shell is stable, and use OOB swaps when one action must refresh several regions—then grow client behavior only where hypermedia alone is awkward.

Automate Your Content with AI Video Generator

Try it Free →