Liking cljdoc? Tell your friends :D

wagoe.shared.ui.core.toast

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.
raw docstring

flash-toastsclj

(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.
sourceraw docstring

oob-toastclj

(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.
sourceraw docstring

redirect-with-toastclj

(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.
sourceraw docstring

region-idclj

source

toastclj

(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.
sourceraw docstring

toast-regionclj

(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.
sourceraw docstring

with-error-toastclj

(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.
sourceraw docstring

with-toastclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close