Progressive Enhancement with HTMX: Ship Fast, Degrade Gracefully

Created: • Updated: • 3 min read
Progressive enhancement with HTMX for small dynamic-feeling sites

Every team building a web product eventually hits the same question: how much JavaScript do we actually need? The answer, for most content and tool-oriented products, is dramatically less than the default React/Next.js/Vue stack assumes. HTMX is one way I keep that budget low without sacrificing user experience.

The business case for progressive enhancement

Progressive enhancement isn't a philosophical stance - it's a risk management strategy. A progressively enhanced site:

  1. Works without JavaScript - your content is accessible to crawlers, screen readers, and users on flaky connections
  2. Gets better with JavaScript - transitions feel snappier, navigation is instant, interactions feel responsive
  3. Fails gracefully - if a script errors out, the user still sees content instead of a white screen

For a small team or solo builder, this translates to fewer support tickets, better SEO out of the box, and less time debugging hydration mismatches at 11pm.

How HTMX fits

HTMX extends HTML with a handful of attributes that replace the boilerplate you'd normally write in JavaScript. Instead of wiring up fetch calls, managing loading states, and diffing DOM updates, you declare the behavior in your markup:

<button
          hx-get="/api/data"
          hx-target="#content"
          hx-swap="innerHTML">
          Load Data
        </button>
        

That button fetches HTML from a server endpoint and swaps it into a target element. No build step, no bundler config, no framework runtime. The server returns HTML - the thing browsers are already optimized to render.

For client-side navigation, the pattern scales naturally:

<a
          hx-get="/article/123/fragment.html"
          hx-push-url="/article/123"
          hx-target="#main-content">
          View Article
        </a>
        

You get URL updates, browser history support, and instant-feeling transitions. If JavaScript fails to load, the href still works as a normal link. That's the progressive enhancement loop in practice.

Why this matters for product teams

The real value isn't "less JavaScript" as an abstract good. It's the concrete business outcomes:

Where it works best

This approach is a natural fit for:

For highly interactive applications - real-time collaboration, complex drag-and-drop interfaces, rich text editors - you'll still reach for heavier tools. The point isn't that HTMX replaces everything. It's that most products don't need everything.

How I use it here

This site is built on a static generation pipeline with Web Components for layout and HTMX for navigation. The HAL system rewrites internal links to fragment swaps at build time, so authors write normal Markdown and readers get SPA-speed navigation.

The total JavaScript budget is around 35KB. The site loads fast, works without JavaScript, and costs nearly nothing to host. More importantly, it lets me focus on content and product work instead of maintaining infrastructure.

HTMX is a tool, not a religion. It happens to be the right tool for this particular problem - shipping a fast, reliable content product with a tiny team and a minimal budget.

Recommended

How This Site Works: Architecture for a One-Person Team web development architecture performance JAMstack
Web Components as a Business Decision web development web components javascript
Less JavaScript, More Leverage: Why I Ship With a 35KB Budget web development performance architecture
Static Site Generation: The Business Case for Pre-Rendered HTML web development JAMstack performance SEO
Fixing Navigation and Analytics: When Your Data Lies About User Behavior htmx analytics ux architecture behind-the-scenes
HAL: Cutting 100-300KB of JavaScript by Moving Routing to Build Time performance jamstack htmx
HAL: Build-Time Link Rewriting That Makes Navigation Feel Instant htmx performance architecture
Web Components + HTMX: A Lean Architecture for Content Sites That Ship architecture web-components htmx performance
Mobile-First Layout That Ships: How PrimaryLayout Solves Real UX Problems ux css layout htmx
Anthropic Trained Its Replacement ai startups founders
Pydantic: The Open Source Layer Quietly Running the AI Economy ai open-source python pydantic anthropic tools
Karpathy Was Wrong: OpenClaw Still Outruns Its 5 Real Alternatives openclaw ai tools security
OpenClaw 2026.2.23: The Agent Browser Upgrade openclaw ai automation tools
The YC S26 Deadline Just Closed. Here's What Separates the 1.5% From Everyone Else. startups yc founders
OpenClaw: What It Is and How to Get the Most Out of It ai automation ops tools
Why I Skipped the CMS architecture content tools
Documentation That Scales: Constitution, Contracts, and Runbooks documentation architecture automation process behind-the-scenes
Zero-Server Analytics: How I Replaced a SaaS Bill with Netlify Functions and GitHub analytics serverless netlify github
Why I Built My Own Analytics Pipeline (And What It Actually Costs) analytics automation behind-the-scenes
The Static Site Playbook: Shipping a Content Product on a Near-Zero Budget jamstack architecture static-site-generation performance

Recommended

How This Site Works: Architecture for a One-Person Team web development architecture performance JAMstack
Web Components as a Business Decision web development web components javascript
Less JavaScript, More Leverage: Why I Ship With a 35KB Budget web development performance architecture
Static Site Generation: The Business Case for Pre-Rendered HTML web development JAMstack performance SEO
Fixing Navigation and Analytics: When Your Data Lies About User Behavior htmx analytics ux architecture behind-the-scenes
HAL: Cutting 100-300KB of JavaScript by Moving Routing to Build Time performance jamstack htmx
HAL: Build-Time Link Rewriting That Makes Navigation Feel Instant htmx performance architecture
Web Components + HTMX: A Lean Architecture for Content Sites That Ship architecture web-components htmx performance
Mobile-First Layout That Ships: How PrimaryLayout Solves Real UX Problems ux css layout htmx
Anthropic Trained Its Replacement ai startups founders
Pydantic: The Open Source Layer Quietly Running the AI Economy ai open-source python pydantic anthropic tools
Karpathy Was Wrong: OpenClaw Still Outruns Its 5 Real Alternatives openclaw ai tools security
OpenClaw 2026.2.23: The Agent Browser Upgrade openclaw ai automation tools
The YC S26 Deadline Just Closed. Here's What Separates the 1.5% From Everyone Else. startups yc founders
OpenClaw: What It Is and How to Get the Most Out of It ai automation ops tools
Why I Skipped the CMS architecture content tools
Documentation That Scales: Constitution, Contracts, and Runbooks documentation architecture automation process behind-the-scenes
Zero-Server Analytics: How I Replaced a SaaS Bill with Netlify Functions and GitHub analytics serverless netlify github
Why I Built My Own Analytics Pipeline (And What It Actually Costs) analytics automation behind-the-scenes
The Static Site Playbook: Shipping a Content Product on a Near-Zero Budget jamstack architecture static-site-generation performance