hx

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boost

func Boost(value ...bool) htm.Mod

Boost progressively enhances anchors and forms to use AJAX.

func Confirm

func Confirm(msg string) htm.Mod

Confirm shows a confirm() dialog before issuing a request.

func Delete

func Delete(url string) htm.Mod

Delete causes an element to issue a DELETE request to the specified URL.

func Disable

func Disable(v ...bool) htm.Mod

Disable disables htmx processing for a given element and its children.

func Disinherit

func Disinherit(v string) htm.Mod

Disinherit allows to control the inheritance of htmx attributes.

func Encoding

func Encoding(v string) htm.Mod

Encoding allows to switch the request encoding from the usual application/x-www-form-urlencoded to multipart/form-data.

func Ext

func Ext(extensions string) htm.Mod

Ext enables an htmx extension for an element and all its children.

func Get

func Get(url string) htm.Mod

Get causes an element to issue a GET request to the specified URL.

func Headers

func Headers(v htm.TypedValue) htm.Mod

Headers adds to the headers that will be submitted with the request. Typically accepts a JSON object.

func History

func History(v bool) htm.Mod

History prevents sensitive data from being saved to the history cache. Usually used as hx-history="false".

func HistoryElt

func HistoryElt() htm.Mod

HistoryElt specifies the element to snapshot and restore during history navigation.

func Include

func Include(selector string) htm.Mod

Include includes additional values in a request.

func Indicator

func Indicator(selector string) htm.Mod

Indicator specifies the element that is indicated during the request (e.g. a loading spinner).

func On

func On(event string, js string) htm.Mod

On sets event handlers (hx-on:event).

func Params

func Params(v string) htm.Mod

Params filters the parameters that will be submitted with a request. Values: "*", "none", "not <list>", or "<list>".

func Patch

func Patch(url string) htm.Mod

Patch causes an element to issue a PATCH request to the specified URL.

func Post

func Post(url string) htm.Mod

Post causes an element to issue a POST request to the specified URL.

func Preserve

func Preserve(v ...bool) htm.Mod

Preserve specifies that an element should be kept invariant across requests (e.g. video players).

func PushURL

func PushURL(v string) htm.Mod

PushURL pushes a new URL into the browser location history. Accepts: "true", "false", or a URL string.

func Put

func Put(url string) htm.Mod

Put causes an element to issue a PUT request to the specified URL.

func ReplaceURL

func ReplaceURL(v string) htm.Mod

ReplaceURL replaces the current URL in the browser location history. Accepts: "true", "false", or a URL string.

func Request

func Request(v htm.TypedValue) htm.Mod

Request allows to configure various aspects of the request. Typically accepts a JSON object.

func Select

func Select(selector string) htm.Mod

Select selects the content to be swapped in from a response.

func SelectOOB

func SelectOOB(selector string) htm.Mod

SelectOOB selects the content to be swapped in from a response, out of band.

func SetBoost

func SetBoost(n *htm.Node, value ...bool)

SetBoost sets the hx-boost attribute on the node.

func SetConfirm

func SetConfirm(n *htm.Node, msg string)

SetConfirm sets the hx-confirm attribute on the node.

func SetDelete

func SetDelete(n *htm.Node, url string)

SetDelete sets the hx-delete attribute on the node.

func SetDisable

func SetDisable(n *htm.Node, v ...bool)

SetDisable sets the hx-disable attribute on the node.

func SetDisinherit

func SetDisinherit(n *htm.Node, v string)

SetDisinherit sets the hx-disinherit attribute on the node.

func SetEncoding

func SetEncoding(n *htm.Node, v string)

SetEncoding sets the hx-encoding attribute on the node.

func SetExt

func SetExt(n *htm.Node, extensions string)

SetExt sets the hx-ext attribute on the node.

func SetGet

func SetGet(n *htm.Node, url string)

SetGet sets the hx-get attribute on the node.

func SetHeaders

func SetHeaders(n *htm.Node, v htm.TypedValue)

SetHeaders sets the hx-headers attribute on the node.

func SetHistory

func SetHistory(n *htm.Node, v bool)

SetHistory sets the hx-history attribute on the node.

func SetHistoryElt

func SetHistoryElt(n *htm.Node)

SetHistoryElt sets the hx-history-elt attribute on the node.

func SetInclude

func SetInclude(n *htm.Node, selector string)

SetInclude sets the hx-include attribute on the node.

func SetIndicator

func SetIndicator(n *htm.Node, selector string)

SetIndicator sets the hx-indicator attribute on the node.

func SetOn

func SetOn(n *htm.Node, event string, js string)

SetOn sets hx-on:[event] attribute on the node.

func SetParams

func SetParams(n *htm.Node, v string)

SetParams sets the hx-params attribute on the node.

func SetPatch

func SetPatch(n *htm.Node, url string)

SetPatch sets the hx-patch attribute on the node.

func SetPost

func SetPost(n *htm.Node, url string)

SetPost sets the hx-post attribute on the node.

func SetPreserve

func SetPreserve(n *htm.Node, v ...bool)

SetPreserve sets the hx-preserve attribute on the node.

func SetPushURL

func SetPushURL(n *htm.Node, v string)

SetPushURL sets the hx-push-url attribute on the node.

func SetPut

func SetPut(n *htm.Node, url string)

SetPut sets the hx-put attribute on the node.

func SetReplaceURL

func SetReplaceURL(n *htm.Node, v string)

SetReplaceURL sets the hx-replace-url attribute on the node.

func SetRequest

func SetRequest(n *htm.Node, v htm.TypedValue)

SetRequest sets the hx-request attribute on the node.

func SetSelect

func SetSelect(n *htm.Node, selector string)

SetSelect sets the hx-select attribute on the node.

func SetSelectOOB

func SetSelectOOB(n *htm.Node, selector string)

SetSelectOOB sets the hx-select-oob attribute on the node.

func SetSwap

func SetSwap(n *htm.Node, strategy string)

SetSwap sets the hx-swap attribute on the node.

func SetSwapOOB

func SetSwapOOB(n *htm.Node, v string)

SetSwapOOB sets the hx-swap-oob attribute on the node.

func SetSync

func SetSync(n *htm.Node, selector string)

SetSync sets the hx-sync attribute on the node.

func SetTarget

func SetTarget(n *htm.Node, selector string)

SetTarget sets the hx-target attribute on the node.

func SetTrigger

func SetTrigger(n *htm.Node, trigger string)

SetTrigger sets the hx-trigger attribute on the node.

func SetValidate

func SetValidate(n *htm.Node, v ...bool)

SetValidate sets the hx-validate attribute on the node.

func SetVals

func SetVals(n *htm.Node, v htm.TypedValue)

SetVals sets the hx-vals attribute on the node.

func Swap

func Swap(strategy string) htm.Mod

Swap controls how the content is swapped in (e.g., "outerHTML", "beforeend").

func SwapOOB

func SwapOOB(v string) htm.Mod

SwapOOB allows to specify that some content in a response should be swapped into the DOM somewhere other than the target.

func Sync

func Sync(selector string) htm.Mod

Sync allows to synchronize AJAX requests between multiple elements.

func Target

func Target(selector string) htm.Mod

Target specifies the target element to be swapped.

func Trigger

func Trigger(trigger string) htm.Mod

Trigger specifies the event that triggers the request.

func Validate

func Validate(v ...bool) htm.Mod

Validate allows to force an element to validate itself before sending a request.

func Vals

func Vals(v htm.TypedValue) htm.Mod

Vals allows to add to the parameters that will be submitted with the request. Typically accepts a JSON object.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL