htmx helpers for Hiccup.
htmx helpers for Hiccup.
(fragment-request? headers target-ids)Whether a request is an htmx control asking for one of target-ids, so a
handler serving the page and its fragment from one URL answers with the
fragment. A history restore asks for the page. Such a handler sends
Vary: HX-Request, HX-Target, so a cache does not answer one with the other.
Whether a request is an htmx control asking for one of `target-ids`, so a handler serving the page and its fragment from one URL answers with the fragment. A history restore asks for the page. Such a handler sends `Vary: HX-Request, HX-Target`, so a cache does not answer one with the other.
(merge-attrs [tag & more] attrs)element with attrs merged over its attribute map (one is added when it
has none).
`element` with `attrs` merged over its attribute map (one is added when it has none).
(oob element)Mark a Hiccup element for an out-of-band swap: htmx swaps it into the
element with the same id, wherever that is on the page. An explicit
:hx-swap-oob (e.g. "beforeend:#toasts") is kept. A seq (from for)
marks each element; strings and nil pass through.
Mark a Hiccup element for an out-of-band swap: htmx swaps it into the element with the same id, wherever that is on the page. An explicit `:hx-swap-oob` (e.g. "beforeend:#toasts") is kept. A seq (from `for`) marks each element; strings and nil pass through.
The Vary header value of a response serving a page and its fragment from
one URL; see fragment-request?.
The Vary header value of a response serving a page and its fragment from one URL; see `fragment-request?`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |