Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetNoSwap ¶
func SetNoSwap(w http.ResponseWriter) error
SetNoSwap disables the hx-swap attribute; causing the existing content to remain in place after HTMX transition.
Useful for setting error messages on forms, allowing users to try again.
func SetRedirect ¶
func SetRedirect(w http.ResponseWriter, path string) error
SetRedirect forces a client-side redirect using HTMX.
Must use this instead of http.SetRedirect when doing a redirect from a request triggered by an HTMX element.
Types ¶
type Component ¶
Component is a raw HTML string rendered using html/template. Fields provides data to the template via the dot (.) context. Funcs allows providing custom template functions.
type Interface ¶
An Interface is used to render an HTMX response. Included by default are implementations for rendering plain text, raw HTML, and file based Go html/templates.