Expand description
Standard HTMX 2 helpers for HX-* headers, hx-swap-oob fragments, and signed flash cookies.
Functionsยง
- flash_
redirect - Set a signed
Flashcookie and return303 See Otherwith bothLocationandHX-Redirect. - is_htmx
- Return
truewhen the request carriesHX-Request: true. - oob
- Wrap
innerin an HTMX out-of-band swap container (hx-swap-oob). - oob_
delete - Emit an HTMX out-of-band delete instruction (
hx-swap-oob="delete") fortarget_id. - oob_
replace - Emit an HTMX out-of-band
outerHTMLswap targetingtarget_id. - redirect
- Return a
200 OKresponse withHX-Redirectso HTMX performs a full navigation. - set_
flash - Store a signed, 60-second expiring one-shot
Flashmessage in theslabs_flashcookie (HttpOnly,SameSite=Lax,Path=/,Max-Age=60). - take_
flash - Read and verify the signed
slabs_flashcookie, removing it fromjarif present. - wants_
json - Return
truewhen theAcceptheader containsapplication/json. - with_
trigger - Return a
200 OKHTML fragment with anHX-Triggerclient event header.