Skip to content

Lightweight HTMX extensions: smart loading indicators, file downloads, and programmatic history restoration. No build step required.

License

Notifications You must be signed in to change notification settings

dakixr/htmx-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HTMX Extensions

Lightweight, zero-dependency HTMX extensions. No build step required.

Extensions

Smart loading indicators that overlay only the target element being updated.

Features:

  • Scoped overlays on target elements (full-screen for body/boosted requests)
  • Configurable delays: 100ms for overlay, 400ms for spinner
  • Automatic handling of concurrent requests
  • Ignores preloaded requests (HX-Preloaded header)
  • Dark mode support (detects .dark class)
  • Opt-out via hx-disinherit="global-indicator"
<script src="https://unpkg.com/htmx.org"></script>
<script src="packages/global-indicator/global-indicator.js"></script>

<div hx-get="/endpoint" hx-ext="global-indicator">
  Click to load
</div>

File downloads (Excel, PDF, etc.) without page reload.

Features:

  • Binary file downloads without DOM swapping
  • Automatic filename extraction from Content-Disposition header
  • Works with any file type
<script src="https://unpkg.com/htmx.org"></script>
<script src="packages/download/htmx-download.js"></script>

<button hx-get="/download/report" hx-ext="htmx-download">
  Download Report
</button>

Programmatic history restoration for custom navigation logic.

<script src="https://unpkg.com/htmx.org"></script>
<script src="packages/restore-history/restore-history.js"></script>

<script>
  // Navigate programmatically while keeping HTMX history in sync
  htmx.restoreHistory('/some/path');
</script>

Requirements

  • HTMX 1.9.0+ or 2.0.0+

License

MIT

About

Lightweight HTMX extensions: smart loading indicators, file downloads, and programmatic history restoration. No build step required.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published