Skip to main content

HtmxAttributes

Definitions for htmx attributes up to 1.9.10.

Path variables

hx-get, hx-post and other request attributes can include path variables by using the path-params extension. Once used as a path variable, it will not be included in the request body.

jsx
<button hx-post="/api/user/{id}" hx-vals="{'id': 1,'foo':true}" hx-ext="path-params">...</button>
// Only 'foo' will be included in the request body
jsx
<button hx-post="/api/user/{id}" hx-vals="{'id': 1,'foo':true}" hx-ext="path-params">...</button>
// Only 'foo' will be included in the request body

Extends

  • HxOnMap

Core

hx-boost?

optional hx-boost: BoolStr

Add or remove progressive enhancement for links and forms.

See

https://htmx.org/attributes/hx-boost/

Source

src/jsx.d.ts:364


hx-get?

optional hx-get: string

Issues a GET to the specified URL.

See

https://htmx.org/attributes/hx-get/

Source

src/jsx.d.ts:335


hx-on-?

optional hx-on-: string

Alternative syntax for hx-on:.

All colons in event handlers can be replaced with a dash, i.e. hx-on:click becomes hx-on-click, hx-on::before-request becomes hx-on--before-request and so on.

See

https://htmx.org/attributes/hx-on/

Since

1.9.10

Source

src/jsx.d.ts:387


hx-on:?

optional hx-on:: string

Handle any event with a script inline.

See

https://htmx.org/attributes/hx-on/

Remarks

Event listeners on htmx-specific events need to be specified with a spread attribute, and are otherwise not supported in vanilla JSX.
Alternatively, use the hx-on- all-dash syntax. (since 1.9.10)

jsx
<div {...{'hx-on::before-request': '...'}} />
jsx
<div {...{'hx-on::before-request': '...'}} />

Since

1.9.3

Source

src/jsx.d.ts:377


hx-post?

optional hx-post: string

Issues a POST to the specified URL.

See

https://htmx.org/attributes/hx-post/

Source

src/jsx.d.ts:341


hx-push-url?

optional hx-push-url: BoolStr | AnyStr

Pushes the URL into the browser location bar, creating a new history entry.

See

https://htmx.org/attributes/hx-push-url/

Source

src/jsx.d.ts:400


hx-select?

optional hx-select: string

CSS selector for content to swap in from a response.

See

https://htmx.org/attributes/hx-select/

Source

src/jsx.d.ts:406


hx-select-oob?

optional hx-select-oob: string

CSS selector for content to swap in from a response, out of band (somewhere other than the target).

See

https://htmx.org/attributes/hx-select-oob/

Source

src/jsx.d.ts:412


hx-swap?

optional hx-swap: true | AnyStr | HxSwap

Controls how content is swapped in (outerHTML, beforeend, afterend, …).

Default

ts
htmx.config.defaultSwapStyle // 'innerHTML'
ts
htmx.config.defaultSwapStyle // 'innerHTML'

See

Remarks

Since

1.9.6: hx-swap can be specified without any swap style.

Source

src/jsx.d.ts:426


hx-target?

optional hx-target: AnyStr | HxTarget

Specifies the target element to be swapped.

Accepts a CSS selector, optionally preceded by a modifier.

See

https://htmx.org/attributes/hx-target/

Source

src/jsx.d.ts:439


hx-trigger?

optional hx-trigger: "path-deps" | "restored" | HxTriggers | AnyStr | "every " | HxTriggerModifier | "sse:"

Specifies the event that triggers the request.

Accepts names of standard DOM events, or htmx-specific events. Optionally followed by a modifier.

See

https://htmx.org/attributes/hx-trigger/

Remarks

Source

src/jsx.d.ts:466


hx-vals?

optional hx-vals: AnyStr | "javascript:" | "js:" | Record ↗️<PropertyKey, unknown>

Adds values to the parameters to submit with the request (JSON-formatted).

Objects may be passed only if supported by the JSX renderer.

See

https://htmx.org/attributes/hx-params/

Source

src/jsx.d.ts:474

Extensions

hx-disable-element?

optional hx-disable-element: AnyStr | "self"

The element or elements to disable during requests. Accepts CSS selectors.

See

https://htmx.org/extensions/disable-element1.9.6: /

Deprecated

1.9.6: superseded by hx-disabled-elt

Source

src/jsx.d.ts:624

Other

_?

optional _: AnyStr

Attach hyperscript behavior to this element. Available separately from htmx.

CDN: https://unpkg.com/hyperscript.org

Source

src/jsx.d.ts:783


hx-confirm?

optional hx-confirm: string

Shows a confirm() dialog before issuing a request.

See

https://htmx.org/attributes/hx-confirm/

Source

src/jsx.d.ts:479


hx-delete?

optional hx-delete: string

Issues a DELETE to the specified URL.

See

https://htmx.org/attributes/hx-delete/

Source

src/jsx.d.ts:351


hx-disable?

optional hx-disable: true

Disables htmx processing for the given node and any children nodes. Useful for escaping user-generated content.

See

https://htmx.org/attributes/hx-disable/

Source

src/jsx.d.ts:485


hx-disabled-elt?

optional hx-disabled-elt: AnyStr | "this" | "closest "

Marks the element to be disabled during a request. Multiple elements are separated by commas.

See

https://htmx.org/attributes/hx-disabled-elt/

Since

1.9.6

Source

src/jsx.d.ts:492


hx-disinherit?

optional hx-disinherit: AnyStr | "*"

Control and disable automatic attribute inheritance for child nodes.

See

https://htmx.org/attributes/hx-disinherit/

Source

src/jsx.d.ts:497


hx-encoding?

optional hx-encoding: "multipart/form-data"

Changes the request encoding type.

See

https://htmx.org/attributes/hx-encoding/

Source

src/jsx.d.ts:502


hx-ext?

optional hx-ext: "sse" | "ajax-headers" | "alpine-morph" | "ws" | "class-tools" | "client-side-templates" | "debug" | "disable-element" | "event-header" | "head-support" | "include-vals" | "morph" | "json-enc" | "loading-states" | "morphdom-swap" | "method-override" | "multi-swap" | "path-deps" | "preload" | "remove-me" | "response-targets" | "restored" | "path-params" | AnyStr | "ignore:"

Extensions to apply to this element and its descendants.

See

Source

src/jsx.d.ts:508


hx-headers?

optional hx-headers: AnyStr | "javascript:" | "js:" | Record ↗️<PropertyKey, unknown>

Adds to the headers that will be submitted with the request.

Objects may be passed only if supported by the JSX renderer.

See

https://htmx.org/attributes/hx-headers/

Source

src/jsx.d.ts:515


hx-history?

optional hx-history: "false"

Prevent sensitive data being saved to the history cache.

See

https://htmx.org/attributes/hx-history/

Source

src/jsx.d.ts:520


hx-history-elt?

optional hx-history-elt: true

Mark the element to snapshot and restore during history navigation.

See

https://htmx.org/attributes/hx-history-elt/

Source

src/jsx.d.ts:525


hx-include?

optional hx-include: AnyStr | "this" | "closest " | "find " | "next " | "previous "

Include additional data in requests. Accepts CSS selectors.

See

https://htmx.org/attributes/hx-include/

Source

src/jsx.d.ts:531


hx-indicator?

optional hx-indicator: AnyStr | "closest "

The element to put the htmx-request class on during the request. Accepts CSS selectors.

See

https://htmx.org/attributes/hx-indicator/

Source

src/jsx.d.ts:537


hx-on?

optional hx-on: HxTriggers | AnyStr

Handle any event with a script inline. Each listener is specified on a separate line.

See

https://htmx.org/attributes/hx-on/

Remarks

Superseded by hx-on:$event, unless IE11 support is required.

Since

1.9.0

Source

src/jsx.d.ts:394


hx-on--abort

hx-on--abort: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--abort


hx-on--after-on-load

hx-on--after-on-load: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--after-on-load


hx-on--after-process-node

hx-on--after-process-node: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--after-process-node


hx-on--after-request

hx-on--after-request: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--after-request


hx-on--after-settle

hx-on--after-settle: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--after-settle


hx-on--after-swap

hx-on--after-swap: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--after-swap


hx-on--before-cleanup-element

hx-on--before-cleanup-element: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--before-cleanup-element


hx-on--before-history-save

hx-on--before-history-save: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--before-history-save


hx-on--before-on-load

hx-on--before-on-load: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--before-on-load


hx-on--before-process-node

hx-on--before-process-node: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--before-process-node


hx-on--before-request

hx-on--before-request: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--before-request


hx-on--before-send

hx-on--before-send: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--before-send


hx-on--before-swap

hx-on--before-swap: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--before-swap


hx-on--config-request

hx-on--config-request: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--config-request


hx-on--confirm

hx-on--confirm: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--confirm


hx-on--history-cache-error

hx-on--history-cache-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--history-cache-error


hx-on--history-cache-miss

hx-on--history-cache-miss: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--history-cache-miss


hx-on--history-cache-miss-error

hx-on--history-cache-miss-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--history-cache-miss-error


hx-on--history-cache-miss-load

hx-on--history-cache-miss-load: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--history-cache-miss-load


hx-on--history-restore

hx-on--history-restore: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--history-restore


hx-on--load

hx-on--load: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--load


hx-on--no-sse-source-error

hx-on--no-sse-source-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--no-sse-source-error


hx-on--on-load-error

hx-on--on-load-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--on-load-error


hx-on--oob-after-swap

hx-on--oob-after-swap: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--oob-after-swap


hx-on--oob-before-swap

hx-on--oob-before-swap: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--oob-before-swap


hx-on--oob-error-no-target

hx-on--oob-error-no-target: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--oob-error-no-target


hx-on--prompt

hx-on--prompt: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--prompt


hx-on--pushed-into-history

hx-on--pushed-into-history: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--pushed-into-history


hx-on--response-error

hx-on--response-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--response-error


hx-on--send-error

hx-on--send-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--send-error


hx-on--sse-error

hx-on--sse-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--sse-error


hx-on--sse-open

hx-on--sse-open: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--sse-open


hx-on--swap-error

hx-on--swap-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--swap-error


hx-on--target-error

hx-on--target-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--target-error


hx-on--timeout

hx-on--timeout: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--timeout


hx-on--validation-failed

hx-on--validation-failed: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--validation-failed


hx-on--validation-halted

hx-on--validation-halted: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--validation-halted


hx-on--validation-validate

hx-on--validation-validate: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--validation-validate


hx-on--xhr-abort

hx-on--xhr-abort: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--xhr-abort


hx-on--xhr-loadend

hx-on--xhr-loadend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--xhr-loadend


hx-on--xhr-loadstart

hx-on--xhr-loadstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--xhr-loadstart


hx-on--xhr-progress

hx-on--xhr-progress: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on--xhr-progress


hx-on-abort

hx-on-abort: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-abort


hx-on-animationcancel

hx-on-animationcancel: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-animationcancel


hx-on-animationend

hx-on-animationend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-animationend


hx-on-animationiteration

hx-on-animationiteration: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-animationiteration


hx-on-animationstart

hx-on-animationstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-animationstart


hx-on-auxclick

hx-on-auxclick: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-auxclick


hx-on-beforeinput

hx-on-beforeinput: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-beforeinput


hx-on-beforetoggle

hx-on-beforetoggle: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-beforetoggle


hx-on-blur

hx-on-blur: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-blur


hx-on-cancel

hx-on-cancel: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-cancel


hx-on-canplay

hx-on-canplay: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-canplay


hx-on-canplaythrough

hx-on-canplaythrough: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-canplaythrough


hx-on-change

hx-on-change: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-change


hx-on-click

hx-on-click: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-click


hx-on-close

hx-on-close: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-close


hx-on-compositionend

hx-on-compositionend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-compositionend


hx-on-compositionstart

hx-on-compositionstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-compositionstart


hx-on-compositionupdate

hx-on-compositionupdate: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-compositionupdate


hx-on-contextmenu

hx-on-contextmenu: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-contextmenu


hx-on-copy

hx-on-copy: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-copy


hx-on-cuechange

hx-on-cuechange: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-cuechange


hx-on-cut

hx-on-cut: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-cut


hx-on-dblclick

hx-on-dblclick: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-dblclick


hx-on-drag

hx-on-drag: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-drag


hx-on-dragend

hx-on-dragend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-dragend


hx-on-dragenter

hx-on-dragenter: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-dragenter


hx-on-dragleave

hx-on-dragleave: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-dragleave


hx-on-dragover

hx-on-dragover: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-dragover


hx-on-dragstart

hx-on-dragstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-dragstart


hx-on-drop

hx-on-drop: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-drop


hx-on-durationchange

hx-on-durationchange: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-durationchange


hx-on-emptied

hx-on-emptied: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-emptied


hx-on-ended

hx-on-ended: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-ended


hx-on-error

hx-on-error: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-error


hx-on-focus

hx-on-focus: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-focus


hx-on-focusin

hx-on-focusin: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-focusin


hx-on-focusout

hx-on-focusout: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-focusout


hx-on-formdata

hx-on-formdata: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-formdata


hx-on-gotpointercapture

hx-on-gotpointercapture: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-gotpointercapture


hx-on-input

hx-on-input: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-input


hx-on-invalid

hx-on-invalid: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-invalid


hx-on-keydown

hx-on-keydown: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-keydown


hx-on-keypress

hx-on-keypress: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-keypress


hx-on-keyup

hx-on-keyup: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-keyup


hx-on-load

hx-on-load: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-load


hx-on-loadeddata

hx-on-loadeddata: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-loadeddata


hx-on-loadedmetadata

hx-on-loadedmetadata: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-loadedmetadata


hx-on-loadstart

hx-on-loadstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-loadstart


hx-on-lostpointercapture

hx-on-lostpointercapture: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-lostpointercapture


hx-on-mousedown

hx-on-mousedown: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-mousedown


hx-on-mouseenter

hx-on-mouseenter: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-mouseenter


hx-on-mouseleave

hx-on-mouseleave: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-mouseleave


hx-on-mousemove

hx-on-mousemove: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-mousemove


hx-on-mouseout

hx-on-mouseout: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-mouseout


hx-on-mouseover

hx-on-mouseover: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-mouseover


hx-on-mouseup

hx-on-mouseup: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-mouseup


hx-on-paste

hx-on-paste: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-paste


hx-on-pause

hx-on-pause: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pause


hx-on-play

hx-on-play: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-play


hx-on-playing

hx-on-playing: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-playing


hx-on-pointercancel

hx-on-pointercancel: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointercancel


hx-on-pointerdown

hx-on-pointerdown: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointerdown


hx-on-pointerenter

hx-on-pointerenter: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointerenter


hx-on-pointerleave

hx-on-pointerleave: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointerleave


hx-on-pointermove

hx-on-pointermove: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointermove


hx-on-pointerout

hx-on-pointerout: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointerout


hx-on-pointerover

hx-on-pointerover: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointerover


hx-on-pointerup

hx-on-pointerup: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-pointerup


hx-on-progress

hx-on-progress: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-progress


hx-on-ratechange

hx-on-ratechange: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-ratechange


hx-on-reset

hx-on-reset: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-reset


hx-on-resize

hx-on-resize: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-resize


hx-on-scroll

hx-on-scroll: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-scroll


hx-on-scrollend

hx-on-scrollend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-scrollend


hx-on-securitypolicyviolation

hx-on-securitypolicyviolation: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-securitypolicyviolation


hx-on-seeked

hx-on-seeked: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-seeked


hx-on-seeking

hx-on-seeking: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-seeking


hx-on-select

hx-on-select: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-select


hx-on-selectionchange

hx-on-selectionchange: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-selectionchange


hx-on-selectstart

hx-on-selectstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-selectstart


hx-on-slotchange

hx-on-slotchange: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-slotchange


hx-on-stalled

hx-on-stalled: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-stalled


hx-on-submit

hx-on-submit: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-submit


hx-on-suspend

hx-on-suspend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-suspend


hx-on-timeupdate

hx-on-timeupdate: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-timeupdate


hx-on-toggle

hx-on-toggle: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-toggle


hx-on-touchcancel

hx-on-touchcancel: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-touchcancel


hx-on-touchend

hx-on-touchend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-touchend


hx-on-touchmove

hx-on-touchmove: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-touchmove


hx-on-touchstart

hx-on-touchstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-touchstart


hx-on-transitioncancel

hx-on-transitioncancel: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-transitioncancel


hx-on-transitionend

hx-on-transitionend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-transitionend


hx-on-transitionrun

hx-on-transitionrun: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-transitionrun


hx-on-transitionstart

hx-on-transitionstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-transitionstart


hx-on-volumechange

hx-on-volumechange: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-volumechange


hx-on-waiting

hx-on-waiting: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-waiting


hx-on-webkitanimationend

hx-on-webkitanimationend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-webkitanimationend


hx-on-webkitanimationiteration

hx-on-webkitanimationiteration: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-webkitanimationiteration


hx-on-webkitanimationstart

hx-on-webkitanimationstart: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-webkitanimationstart


hx-on-webkittransitionend

hx-on-webkittransitionend: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-webkittransitionend


hx-on-wheel

hx-on-wheel: undefined | string

Inherited from

HtmxUtils.HxOnMap.hx-on-wheel


hx-params?

optional hx-params: AnyStr | "none" | "*" | "not "

Filters the parameters that will be submitted with a request.

See

https://htmx.org/attributes/hx-params/

Source

src/jsx.d.ts:542


hx-patch?

optional hx-patch: string

Issues a PATCH to the specified URL.

See

https://htmx.org/attributes/hx-patch/

Source

src/jsx.d.ts:356


hx-preserve?

optional hx-preserve: "true"

Specifies elements to keep unchanged between requests. An ID on the element is also required, and is the only criterion for preservation.

See

https://htmx.org/attributes/hx-preserve/

Remarks

This attribute is observed by the head-support extension, where it prevents an element from being removed from <head>.

Source

src/jsx.d.ts:552


hx-prompt?

optional hx-prompt: string

Shows a prompt() before submitting a request.

See

https://htmx.org/attributes/hx-prompt/

Source

src/jsx.d.ts:557


hx-put?

optional hx-put: string

Issues a PUT to the specified URL.

See

https://htmx.org/attributes/hx-put/

Source

src/jsx.d.ts:346


hx-replace-url?

optional hx-replace-url: BoolStr | AnyStr

Replace the URL in the browser location bar.

See

https://htmx.org/attributes/hx-replace-url/

Source

src/jsx.d.ts:562


hx-request?

optional hx-request: AnyStr | "javascript:" | "js:" | ""timeout":" | ""credentials":" | ""noHeaders":"

Configures various aspects of the request.

See

https://htmx.org/attributes/hx-request/

Source

src/jsx.d.ts:567


hx-swap-oob?

optional hx-swap-oob: "true" | AnyStr | HxSwap

Marks content in a response to be out of band (should swap in somewhere other than the target).

See

https://htmx.org/attributes/hx-swap-oob/

Source

src/jsx.d.ts:431


hx-sync?

optional hx-sync: AnyStr | "this" | "closest " | HxSync

Control how requests made by different elements are synchronized.

Accepts a CSS selector, optionally followed by a colon and a sync strategy.

See

https://htmx.org/attributes/hx-sync/

Source

src/jsx.d.ts:574


hx-validate?

optional hx-validate: "true"

Force elements to validate themselves before a request.

See

https://htmx.org/attributes/hx-validate/

Source

src/jsx.d.ts:579


hx-vars?

optional hx-vars: AnyStr

Adds values dynamically to the parameters to submit with the request.

Deprecated

superseded by hx-vals

Source

src/jsx.d.ts:584

Extensions

classes?

optional classes: AnyStr | "add " | "remove " | "toggle "

Apply class transitions on this element.

See

https://htmx.org/extensions/class-tools/

Source

src/jsx.d.ts:614


data-loading?

optional data-loading: string | true

Shows this element during a pending request.

See

Source

src/jsx.d.ts:691


data-loading-aria-busy?

optional data-loading-aria-busy: true

Adds aria-busy="true" to this element for the duration of a pending request.

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:717


data-loading-class?

optional data-loading-class: string

Adds these classes to this element during a pending request, and removes them when the request is complete.

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:698


data-loading-class-remove?

optional data-loading-class-remove: string

Removes these classes from this element during a pending request, and adds them back when the request is complete.

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:711


data-loading-delay?

optional data-loading-delay: string

Only applies loading states after this many milliseconds.

Default

ts
200
ts
200

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:724


data-loading-disable?

optional data-loading-disable: true

Disables this element for the duration of a pending request.

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:704


data-loading-path?

optional data-loading-path: string

Only applies loading states for this request.

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:737


data-loading-states?

optional data-loading-states: true

Define a scope for loading states, so only descendants are processed.

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:743


data-loading-target?

optional data-loading-target: string

Specify a different target to apply loading states. Accepts a CSS selector.

See

https://htmx.org/extensions/loading-states/

Source

src/jsx.d.ts:731


handlebars-array-template?

optional handlebars-array-template: string

The ID of a Handlebars <template> to render the response with. Selected when the response is an array.

See

https://htmx.org/extensions/client-side-templates/

Source

src/jsx.d.ts:656


handlebars-template?

optional handlebars-template: string

The ID of a Handlebars <template> to render the response with.

See

https://htmx.org/extensions/client-side-templates/

Source

src/jsx.d.ts:649


hx-head?

optional hx-head: "merge" | "append" | "re-eval"

The strategy for merging new head content.

See

https://htmx.org/extensions/head-support/

Source

src/jsx.d.ts:630


hx-target-?

optional hx-target-: AnyStr | HxTarget

Specifies the target element to be swapped, when a specific error code is encountered.

Error codes may also be specified as wildcards, e.g. hx-target-5* or hx-target-5x.

See

https://htmx.org/extensions/response-targets/

Source

src/jsx.d.ts:447


hx-target-error?

optional hx-target-error: AnyStr | HxTarget

Specifies a catch-all target element to be swapped when a 4xx or 5xx response is encountered.

See

https://htmx.org/extensions/response-targets/

Source

src/jsx.d.ts:453


include-vals?

optional include-vals: string

Include additional data in requests.

See

https://htmx.org/extensions/include-vals/

Source

src/jsx.d.ts:684


mustache-array-template?

optional mustache-array-template: string

The ID of a Mustache <template> to render the response with. Selected when the response is an array.

See

https://htmx.org/extensions/client-side-templates/#full-mustache-html-example

Source

src/jsx.d.ts:643


mustache-template?

optional mustache-template: string

The ID of a Mustache <template> to render the response with.

See

https://htmx.org/extensions/client-side-templates/#full-mustache-html-example

Source

src/jsx.d.ts:636


nunjucks-array-template?

optional nunjucks-array-template: string

The ID of a Nunjucks <template> to render the response with. Selected when the response is an array.

See

https://htmx.org/extensions/client-side-templates/

Source

src/jsx.d.ts:670


nunjucks-template?

optional nunjucks-template: string

The ID of a Nunjucks <template> to render the response with.

See

Source

src/jsx.d.ts:663


path-deps?

optional path-deps: string

When any other mutating requests are made to this path (or its subpaths), a request for this element should also be triggered.

See

https://htmx.org/extensions/path-deps/

Source

src/jsx.d.ts:750


preload?

optional preload: true | "mousedown" | "mouseover" | AnyStr

Opt into HTML fragment preloading.

Only GET requests are preloaded. Note that this attribute is inherited.

Image preloading
html
<a href="/.." preload="mouseover" preload-images="true">...</a>
html
<a href="/.." preload="mouseover" preload-images="true">...</a>

Default

ts
'mousedown'
ts
'mousedown'

See

https://htmx.org/extensions/preload/

Source

src/jsx.d.ts:764


preload-images?

optional preload-images: "true"

Opt into image preloading.

See

https://htmx.org/extensions/preload/

Source

src/jsx.d.ts:770


remove-me?

optional remove-me: string

Specify the duration after which this element should be removed.

See

https://htmx.org/extensions/remove-me/

Source

src/jsx.d.ts:776


sse-connect?

optional sse-connect: string

The URL of the SSE server.

See

https://htmx.org/extensions/server-sent-events/

Source

src/jsx.d.ts:590


sse-swap?

optional sse-swap: string

The name of the message to swap into the DOM.

See

https://htmx.org/extensions/server-sent-events/

Source

src/jsx.d.ts:596


ws-connect?

optional ws-connect: string

A URL to establish a WebSocket connection against.

See

https://htmx.org/extensions/web-sockets/

Source

src/jsx.d.ts:602


ws-send?

optional ws-send: boolean

Sends a message to the nearest websocket based on the trigger value for the element.

See

https://htmx.org/extensions/web-sockets/

Source

src/jsx.d.ts:608


xslt-template?

optional xslt-template: string

The ID of a XSLTProcessor XSLT <template> to render the response with.

See

Source

src/jsx.d.ts:678