Toasts: a live region every page layout renders, and toasts an htmx
response adds to it out of band. The toast Alpine component in
components.js dismisses them.
Toasts: a live region every page layout renders, and toasts an htmx response adds to it out of band. The `toast` Alpine component in components.js dismisses them.
(flash-toasts flash)Toasts for a Ring flash, in either shape it is set in: {:type :success :message m} or {:success m, :error m2}. They wait in a template that components.js empties into the region once the page is up, since a live region announces only what is added to it.
Toasts for a Ring flash, in either shape it is set in:
{:type :success :message m} or {:success m, :error m2}. They wait in a
template that components.js empties into the region once the page is up,
since a live region announces only what is added to it.(oob-toast opts)A toast as an out-of-band swap: htmx appends it to the region, whatever the rest of the response replaces.
A toast as an out-of-band swap: htmx appends it to the region, whatever the rest of the response replaces.
(redirect-with-toast location type message)A response sending htmx to location with a toast to show there:
components.js keeps the X-Toast across the redirect.
A response sending htmx to `location` with a toast to show there: components.js keeps the X-Toast across the redirect.
(toast {:keys [type message]})One toast. :type is :success, :info (default), :warning or :error; a
keyword :message is a catalogue key.
It goes after five seconds; an error stays until it is closed, since a
message that leaves on its own may go unread.
One toast. `:type` is :success, :info (default), :warning or :error; a keyword `:message` is a catalogue key. It goes after five seconds; an error stays until it is closed, since a message that leaves on its own may go unread.
(toast-region)The region toasts appear in. A swap of the body keeps it (hx-preserve), so it stays the live region a screen reader is watching. An empty toast of each type waits in a template, for components.js to fill in. The data attributes are the words admin-ux.js toasts a failed request with.
The region toasts appear in. A swap of the body keeps it (hx-preserve), so it stays the live region a screen reader is watching. An empty toast of each type waits in a template, for components.js to fill in. The data attributes are the words admin-ux.js toasts a failed request with.
(with-error-toast response message)Failed response with message as an error toast: htmx swaps no 4xx/5xx
body, so a button's request would fail silently.
Failed `response` with `message` as an error toast: htmx swaps no 4xx/5xx body, so a button's request would fail silently.
(with-toast response opts render)response with a toast appended to its HTML body, out of band. render
turns Hiccup into a string, resolving any i18n markers in the message.
htmx ignores the body of a 4xx/5xx unless told to swap it, and a response
that replaces the body replaces the region too: there pass a flash to the
layout instead.
`response` with a toast appended to its HTML body, out of band. `render` turns Hiccup into a string, resolving any i18n markers in the message. htmx ignores the body of a 4xx/5xx unless told to swap it, and a response that replaces the body replaces the region too: there pass a flash to the layout instead.
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 |