liveBook · Manning

Hx-trigger attribute

The hx-trigger attribute specifies the browser events and timing conditions that cause HTMX to issue a request or refresh an element.

How 2 Manning books explain it

Django in Action

hx-trigger is an HTMX HTML attribute that specifies the browser event and timing conditions that initiate an HTMX request.

How it is used
Controls when an HTMX HTTP request runs for interactions, page loading, typing, and visible scrolling elements.
How deep it goes
Explains concrete trigger values and filters through lazy loading, search, and infinite-scroll implementations rather than HTMX internals.
Examples
Demonstrates a delayed promoter listing, debounced musician search, and revealed-element pagination for infinite scroll.
What you can do after
Apply it via HTMX to time GET requests for loading content, searching input, and fetching additional scrolling results.

Read how Django in Action explains hx-trigger attribute →

Quarkus in Action

The hx-trigger attribute declares the events that cause HTMX to issue a request or refresh an element.

How it is used
Controls when HTMX requests refresh reservation-page tables.
How deep it goes
Works through load and a custom body event on an availability div, without cataloging other triggers.
Examples
Shows tables loading on page entry and an availability list listening for a reservation-driven refresh event.
What you can do after
Apply it via HTMX to load tables on page entry and listen for a custom refresh event.

Read how Quarkus in Action explains hx-trigger attribute →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.