Request Lifecycle
- htmx:config:request - fires before request data is encoded
- htmx:confirm - fires before handling
hx-confirm - htmx:before:request - fires immediately before
fetch() - htmx:before:response - fires after
fetch(), beforeresponse.text() - htmx:after:request - fires after
response.text() - htmx:response:error - fires for HTTP status 400 or higher
- htmx:before:swap - fires before DOM update
- htmx:before:settle - fires after DOM insertion, before settle tasks
- htmx:after:settle - fires after settle tasks
- htmx:after:swap - fires after DOM update
- htmx:finally:swap - at the end of swap lifecycle
- htmx:finally:request - fires after lifecycle ends, including failures
- htmx:error - fires after request or swap exception
- htmx:abort - aborts in-flight request
Elements
- htmx:before:init - fires before element initialization
- htmx:after:init - fires after element initialization
- htmx:before:process - fires before DOM node processing
- htmx:after:process - fires after DOM node processing
- htmx:before:on:init - fires before htmx wires the hx-on attributes
- htmx:before:cleanup - fires before element data removal
- htmx:after:cleanup - fires after element data removal
- load - fires after element initialization
History Events
- htmx:before:history:update - fires before browser history update
- htmx:after:history:update - fires after browser history update
- htmx:after:history:push - fires after history push
- htmx:after:history:replace - fires after history replacement
- htmx:before:history:restore - fires before history restoration
View Transitions
- htmx:before:viewTransition - fires before view transition starts
- htmx:after:viewTransition - fires after view transition completes