Components
Button
hitmix/components/button is a ready-made
button that wires htmx attributes straight through, so a single tag can post to a route and swap the
response in without any extra markup.
Usage
<import src="hitmix/components/button" as="button" />
<button
hx-post="/"
hx-target="#greeting-result"
hx-swap="innerHTML"
label="Say hello"
/>
Props
label— the button text (defaults to "Click me")hx-post— the route to submit tohx-target— the element the response replaceshx-swap— how the response is swapped in (e.g.innerHTML)hx-vals— a JSON string of extra values to send with the request