Examples
Toasts from the server
Each button posts to Quarkus; the server replies with only an HX-Trigger header. The
danger button asks for confirmation in a PF modal first.
Documentation
Usage
The server decides what deserves a toast. Actions respond
hx-swap="none" with an HX-Trigger header carrying the
toast payload; /web/js/htmx/toast.js listens for the event and renders a stacking PF
toast alert that auto-dismisses. No toast state on the page, no polling.
Confirm without window.confirm. Buttons marked
data-pha-confirm have their htmx:confirm event
intercepted: the PF modal opens with the
hx-confirm text, and only the modal's Confirm button lets the request proceed.