HtmxBuiltinExtensions
An extensible directory of htmx extensions.
Declaring a new extension
tsx
// in foo.d.ts:declareglobal {namespaceJSX {interfaceHtmxExtensions {myExtension : "my-extension";}interfaceHtmlTag {/** Describe your attribute */["my-extension-attr"]?: "true" | "false";// Add any other attributes your extension uses here}}}<div hx-ext ="my-extension"><span my-extension-attr ="true">Hello</span ></div >
tsx
// in foo.d.ts:declareglobal {namespaceJSX {interfaceHtmxExtensions {myExtension : "my-extension";}interfaceHtmlTag {/** Describe your attribute */["my-extension-attr"]?: "true" | "false";// Add any other attributes your extension uses here}}}<div hx-ext ="my-extension"><span my-extension-attr ="true">Hello</span ></div >
Properties
ajaxHeaders
ajaxHeaders:
"ajax-headers"
Includes the commonly-used X-Requested-With
header that identifies ajax requests in many backend frameworks.
CDN: https://unpkg.com/htmx.org/dist/ext/ajax-header.js
See
https://htmx.org/extensions/ajax-header/
Source
alpineMorph
alpineMorph:
"alpine-morph"
Uses the Alpine.js morph plugin to swap content.
CDN: https://unpkg.com/htmx.org/dist/ext/alpine-morph.js
See
https://htmx.org/extensions/alpine-morph/
Source
classTools
classTools:
"class-tools"
Class utilities.
CDN: https://unpkg.com/htmx.org/dist/ext/class-tools.js
See
https://htmx.org/extensions/class-tools/
Source
clientSideTemplates
clientSideTemplates:
"client-side-templates"
Transforms JSON/XML responses into HTML.
CDN: https://unpkg.com/htmx.org/dist/ext/client-side-templates.js
See
https://htmx.org/extensions/client-side-templates/
Source
debug
debug:
"debug"
Tool for debugging htmx requests.
CDN: https://unpkg.com/htmx.org/dist/ext/debug.js
See
https://htmx.org/extensions/debug/
Source
disableElement
disableElement:
"disable-element"
Disable elements during requests.
CDN: https://unpkg.com/htmx.org/dist/ext/disable-element.js
See
https://htmx.org/extensions/disable-element/
Deprecated
1.9.6: Included into htmx core as hx-disabled-elt
.
Source
eventHeader
eventHeader:
"event-header"
Includes the JSON of the event that triggered a request
to the Triggering-Event
header.
CDN: https://unpkg.com/htmx.org/dist/ext/event-header.js
See
https://htmx.org/extensions/event-header/
Source
headSupport
headSupport:
"head-support"
Support for adding tags to <head>
.
CDN: https://unpkg.com/htmx.org/dist/ext/head-support.js
See
https://htmx.org/extensions/head-support/
Source
idiomorph
idiomorph:
"morph"
Support for Idiomorph, an alternative swapping mechanism for htmx.
CDN: https://unpkg.com/idiomorph/dist/idiomorph-ext.min.js
See
https://github.com/bigskysoftware/idiomorph#htmx
Source
includeVals
includeVals:
"include-vals"
Include additional data in requests.
CDN: https://unpkg.com/htmx.org/dist/ext/include-vals.js
Source
jsonEncode
jsonEncode:
"json-enc"
Use JSON encoding in the body of requests, rather than the default x-www-form-urlencoded
.
CDN: https://unpkg.com/htmx.org/dist/ext/json-enc.js
See
https://htmx.org/extensions/json-enc/
Source
loadingStates
loadingStates:
"loading-states"
Support for inflight loading states.
CDN: https://unpkg.com/htmx.org/dist/ext/loading-states.js
See
https://htmx.org/extensions/loading-states/
Source
methodOverride
methodOverride:
"method-override"
Use X-HTTP-Method-Override
for non-GET and -POST requests.
Useful for bypassing firewalls or proxies.
CDN: https://unpkg.com/htmx.org/dist/ext/method-override.js
See
https://htmx.org/extensions/method-override/
Source
morphdomSwap
morphdomSwap:
"morphdom-swap"
Support for morphdom, an alternative swapping mechanism for htmx.
CDN: https://unpkg.com/htmx.org/dist/ext/morphdom-swap.js
See
https://htmx.org/extensions/morphdom-swap/
Source
multiSwap
multiSwap:
"multi-swap"
Swap multiple elements marked with IDs, each optionally followed by a swap style.
CDN: https://unpkg.com/htmx.org/dist/ext/multi-swap.js
See
https://htmx.org/extensions/multi-swap/
Source
pathDeps
pathDeps:
"path-deps"
Express dependencies between requests.
CDN: https://unpkg.com/htmx.org/dist/ext/path-deps.js
See
https://htmx.org/extensions/path-deps/
Source
pathParams
pathParams:
"path-params"
Use specific parameters as path variables.
CDN: https://unpkg.com/htmx.org/dist/ext/path-params.js
See
https://htmx.org/extensions/path-params/