Crate fun_htmx

Crate fun_htmx 

Source
Expand description

This crate provides a collection of HTMX attributes for fun-html

§Example

use fun_html::{elt::{script_empty, button, text}, attr::src};
use fun_htmx::{hx_get, hx_swap_outer_html};

let quick_start = [
   script_empty([src("https://unpkg.com/htmx.org@2.0.3")]),
   button(
     [hx_get("/clicked"), hx_swap_outer_html()],
     text("Click Me")
   ),
];

§Feature flags

  • std: enabled by default. must be disabled to compile to no_std
  • serde_json: Add utilities like hx_vals_serde(values: &impl Serialize) that relies on serde serialization to output json

Functions§

hx_boost
hx-boost attribute
hx_confirm
hx-confirm attribute
hx_delete
hx-delete attribute
hx_disinherit
hx-disinherit attribute
hx_disinherit_all
hx-disinherit="*"
hx_get
hx-get attribute
hx_on
hx-on* attributes
hx_on_htmx_after_request
hx-on:htmx:after-request attribute
hx_on_htmx_before_request
hx-on:htmx:before-request attribute
hx_patch
hx-patch attribute
hx_post
hx-post attribute
hx_push_url
hx-push-url attribute using a boolean
hx_push_url_str
hx-push-url attribute using an URL
hx_put
hx-put attribute
hx_select
hx-select attribute
hx_swap
hx-swap attribute
hx_swap_after_begin
hx-swap="afterbegin"
hx_swap_after_end
hx-swap="afterend"
hx_swap_before_begin
hx-swap="beforebegin"
hx_swap_before_end
hx-swap="beforeend"
hx_swap_delete
hx-swap="delete"
hx_swap_inner_html
hx-swap="innerHTML"
hx_swap_none
hx-swap="none"
hx_swap_oob
`hx-swap-oob=“true”
hx_swap_oob_swap
hx-swap-oob attribute
hx_swap_outer_html
hx-swap="outerHTML"
hx_swap_text_content
hx-swap="textContent"
hx_target
hx-target attribute
hx_trigger
hx-trigger attribute
hx_vals
hx-vals attribute
hx_vals_serdeserde_json
hx-vals attribute using serde Serialization