Htmx response headers: HX-Trigger, HX-Trigger-After-Swap, HX-Trigger-After-Settle

Use this response header to send event trigers to ANY client side browser event (javascript, htmx, custom, etc)

HX-Trigger - as soon as response received
HX-Trigger-After-Swap - after new html is swapped in
HX-Trigger-After-Settle - after new html is settled and processed by browser

  1. single event
    HX-Trigger:event

  2. multiple events
    HX-Trigger:event1, event2 

  3. single event with value
    HX-Trigger:{“event1”:”event 1 message”} 

  4. single events with key/value data
    HX-Trigger:{“event1:{“key1”:”value1,”key2:”value2”}}

  5. multiple events with key/value data 
    HX-Trigger:{“event1:{“key1”:”value1,”key2:”value2”}, “event2”:{“key1”:”value1,”key2:”value2”}}


Htmx response headers: HX-Trigger, HX-Trigger-After-Swap, HX-Trigger-After-Settle
Broadcast by