HtmxConfig
Htmx has some configuration options that can be accessed either programmatically or declaratively.
Constructors
Properties
defaults to htmx-added
defaults to true, whether to process OOB swaps on elements that are nested within the main response element. See Nested OOB Swaps.
defaults to true, determines if htmx will process script tags found in new content
defaults to "class", "style", "width", "height", the attributes to settle during the settling phase
if the focused element should be scrolled into view, defaults to false and can be overridden using the focus-scroll swap modifier.
defaults to 20
defaults to 0
defaults to innerHTML
defaults to hx-disable, data-hx-disable, htmx will not process elements with this attribute on it or a parent
defaults to false, if set to true htmx will include a cache-busting parameter in GET requests to avoid caching partial responses by the browser
if set to true, htmx will use the View Transition API when swapping in new content.
defaults to 10
defaults to true, really only useful for testing
defaults to false, if set to true htmx will not update the title of the document when a title tag is found in new content
defaults to true (determines if the indicator styles are loaded)
defaults to htmx-indicator
defaults to '', meaning that no nonce will be added to inline scripts
defaults to "get", htmx will format requests with these methods by encoding their parameters in the URL, not the request body
defaults to false, if set to true htmx will issue a full page refresh on history misses rather than use an AJAX request
defaults to htmx-request
defaults to ‘smooth’, the behavior for a boosted link on page transitions. The allowed values are auto and smooth. Smooth will smoothscroll to the top of the page while auto will behave like a vanilla link.
defaults to true, whether or not the target of a boosted element is scrolled into the viewport. If hx-target is omitted on a boosted element, the target defaults to body, causing the page to scroll to the top.
defaults to false, if set to true will only allow AJAX requests to the same domain as the current document
defaults to htmx-settling
defaults to htmx-swapping
defaults to null, the cache to store evaluated trigger specifications into, improving parsing performance at the cost of more memory usage. You may define a simple object to use a never-clearing cache, or implement your own system using a proxy object
defaults to false, allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates
defaults to blob, the type of binary data being received over the WebSocket connection
defaults to full-jitter