HTMX
Loading states, error handling, polling, OOB swaps.
# HTMX LoadingIndicator
Global HTMX loading overlay (shows during any htmx request — try any button below):
# HTMX InlineLoadingOverlay
Per-target loading indicator (shown via hx-indicator):
# HTMX LoadingButton
Click — the button swaps to its loading state during the request:
# HTMX ConfirmDelete
Deletes the item below via HTMX after a confirmation dialog:
item-123
Delete me — the row is replaced by the server response.
# HTMX CSRFToken
Renders a hidden CSRF input field:
# HTMX SwapOOB
Out-of-band swap element (processed by HTMX after a response):
# HTMX GlobalErrorHandling
Wires up htmx:responseError and htmx:beforeOnError events:
# HTMX ViewTransitions
Enables native View Transitions on HTMX swaps — pages cross-fade instead of hard-cutting, with graceful degradation in browsers without support.
htmx.ViewTransitions(htmx.ViewTransitionsProps{Global: true, Nonce: nonce})# HTMX PolledRegion
Auto-refreshing region polling /api/demo-stats every 5s (stops after 3 ticks):
Requests served: 48210
Updated 03:10:30 UTC