Debian Codegraph @

src/editors/jetbrains/htmx.web-types.json

raw symbols SCIP
1 {
2 "$schema": "https://json.schemastore.org/web-types",
3 "name": "htmx",
4 "version": "4.0.0-alpha.6",
5 "default-icon": "./htmx.svg",
6 "js-types-syntax": "typescript",
7 "description-markup": "markdown",
8 "contributions": {
9 "html": {
10 "attributes": [
11 {
12 "name": "hx-action",
13 "description": "The `hx-action` attribute specifies the URL to make a request to. This attribute should be used with `hx-method` to specify the HTTP method.\n\n```html\n<button hx-method=\"POST\" hx-action=\"/api/data\">\n Submit\n</button>\n```\n\nThis provides an alternative to the verb-specific attributes like `hx-get`, `hx-post`, etc.",
14 "doc-url": "https://htmx.org/attributes/hx-action/"
15 },
16 {
17 "name": "hx-boost",
18 "description": "The `hx-boost` attribute allows you to \"boost\" normal anchors and form tags to use AJAX instead. This\nhas the [nice fallback](https://en.wikipedia.org/wiki/Progressive_enhancement) that, if the user does not \nhave javascript enabled, the site will continue to work.\n\nFor anchor tags, clicking on the anchor will issue a `GET` request to the url specified in the `href` and\nwill push the url so that a history entry is created. The target is the `<body>` tag, and the `innerHTML`\nswap strategy is used by default. All of these can be modified by using the appropriate attributes, except\nthe `click` trigger.",
19 "description-sections": {
20 "Inheritance": "Use the :inherited modifier (e.g., `hx-boost:inherited`) to make this attribute inherit to child elements"
21 },
22 "doc-url": "https://htmx.org/attributes/hx-boost/"
23 },
24 {
25 "name": "hx-config",
26 "description": "The `hx-config` attribute allows you to configure various aspects of the request behavior using JSON syntax.\n\nYou can configure:\n* Request validation\n* SSE (Server-Sent Events) settings\n* Transition settings\n\nExample:\n```html\n<div hx-config='{\"validate\": false, \"transition\": false}'>\n ...\n</div>\n```",
27 "description-sections": {
28 "Inheritance": "Use the :inherited modifier (e.g., `hx-config:inherited`) to make this attribute inherit to child elements"
29 },
30 "doc-url": "https://htmx.org/attributes/hx-config/"
31 },
32 {
33 "name": "hx-confirm",
34 "description": "The `hx-confirm` attribute allows you to confirm an action before issuing a request. This can be useful\nin cases where the action is destructive and you want to ensure that the user really wants to do it.\n\nIn htmx 4, you can also use an async JavaScript function for custom confirmation dialogs.\n\nExample with simple confirmation:\n```html\n<button hx-delete=\"/account\" hx-confirm=\"Are you sure you wish to delete your account?\">\n Delete My Account\n</button>\n```\n\nExample with async JavaScript:\n```html\n<button hx-delete=\"/account\" hx-confirm=\"js:await customConfirm()\">\n Delete My Account\n</button>\n```",
35 "description-sections": {
36 "Inheritance": "Use the :inherited modifier (e.g., `hx-confirm:inherited`) to make this attribute inherit to child elements"
37 },
38 "doc-url": "https://htmx.org/attributes/hx-confirm/"
39 },
40 {
41 "name": "hx-delete",
42 "description": "The `hx-delete` attribute will cause an element to issue a `DELETE` to the specified URL and swap\nthe HTML into the DOM using a swap strategy:\n\n```html\n<button hx-delete=\"/account\" hx-target=\"body\">\n Delete Your Account\n</button>\n```",
43 "doc-url": "https://htmx.org/attributes/hx-delete/"
44 },
45 {
46 "name": "hx-disable",
47 "description": "The `hx-disable` attribute allows you to disable elements for the duration of a request. The value of this attribute can be:\n\n* A CSS query selector of the element to disable.\n* `this` to disable the element itself\n* `closest <CSS selector>` which will find the [closest](https://developer.mozilla.org/docs/Web/API/Element/closest)\n ancestor element or itself, that matches the given CSS selector\n* `find <CSS selector>` which will find the first child descendant element that matches the given CSS selector\n* `next` which resolves to [element.nextElementSibling](https://developer.mozilla.org/docs/Web/API/Element/nextElementSibling)\n* `next <CSS selector>` which will scan the DOM forward for the first element that matches the given CSS selector\n* `previous` which resolves to [element.previousElementSibling](https://developer.mozilla.org/docs/Web/API/Element/previousElementSibling)\n* `previous <CSS selector>` which will scan the DOM backwards for the first element that matches the given CSS selector.\n\nNote: This was called `hx-disabled-elt` in htmx 2.x.",
48 "description-sections": {
49 "Inheritance": "Use the :inherited modifier (e.g., `hx-disable:inherited`) to make this attribute inherit to child elements"
50 },
51 "doc-url": "https://htmx.org/attributes/hx-disable/"
52 },
53 {
54 "name": "hx-encoding",
55 "description": "The `hx-encoding` attribute allows you to switch the request encoding from the usual `application/x-www-form-urlencoded`\nencoding to `multipart/form-data`, usually to support file uploads in an ajax request.\n\nThe value of this attribute should be `multipart/form-data`.",
56 "description-sections": {
57 "Inheritance": "Use the :inherited modifier (e.g., `hx-encoding:inherited`) to make this attribute inherit to child elements"
58 },
59 "doc-url": "https://htmx.org/attributes/hx-encoding/"
60 },
61 {
62 "name": "hx-get",
63 "description": "The `hx-get` attribute will cause an element to issue a `GET` to the specified URL and swap\nthe HTML into the DOM using a swap strategy:\n\n```html\n <button hx-get=\"/example\">Get Some HTML</button>\n```",
64 "doc-url": "https://htmx.org/attributes/hx-get/"
65 },
66 {
67 "name": "hx-headers",
68 "description": "The `hx-headers` attribute allows you to add to the headers that will be submitted with an AJAX request.\n\nBy default, the value of this attribute is a list of name-expression values in [JSON (JavaScript Object Notation)](https://www.json.org/json-en.html)\nformat.",
69 "description-sections": {
70 "Inheritance": "Use the :inherited modifier (e.g., `hx-headers:inherited`) to make this attribute inherit to child elements"
71 },
72 "doc-url": "https://htmx.org/attributes/hx-headers/"
73 },
74 {
75 "name": "hx-ignore",
76 "description": "The `hx-ignore` attribute will disable htmx processing for a given element and all its children. This can be \nuseful as a backup for HTML escaping, when you include user generated content in your site, and you want to \nprevent malicious scripting attacks.\n\nThe value of the tag is ignored, and it cannot be reversed by any content beneath it.\n\nNote: This replaces `hx-disable` from htmx 2.x, which served this purpose.",
77 "description-sections": {
78 "Inheritance": "Use the :inherited modifier (e.g., `hx-ignore:inherited`) to make this attribute inherit to child elements"
79 },
80 "doc-url": "https://htmx.org/attributes/hx-ignore/"
81 },
82 {
83 "name": "hx-include",
84 "description": "The `hx-include` attribute allows you to include additional element values in an AJAX request. The value of this\nattribute can be:\n\n* A CSS query selector of the elements to include.\n* `this` which will include the descendants of the element.\n* `closest <CSS selector>` which will find the [closest](https://developer.mozilla.org/docs/Web/API/Element/closest)\n ancestor element or itself, that matches the given CSS selector\n* `find <CSS selector>` which will find the first child descendant element that matches the given CSS selector.\n* `next <CSS selector>` which will scan the DOM forward for the first element that matches the given CSS selector.\n* `previous <CSS selector>` which will scan the DOM backwards for the first element that matches the given CSS selector.",
85 "description-sections": {
86 "Inheritance": "Use the :inherited modifier (e.g., `hx-include:inherited`) to make this attribute inherit to child elements"
87 },
88 "doc-url": "https://htmx.org/attributes/hx-include/"
89 },
90 {
91 "name": "hx-indicator",
92 "description": "The `hx-indicator` attribute allows you to specify the element that will have the `htmx-request` class\nadded to it for the duration of the request. This can be used to show spinners or progress indicators\nwhile the request is in flight.\n\nThe value of this attribute is a CSS query selector of the element or elements to apply the class to,\nor the keyword [`closest`](https://developer.mozilla.org/docs/Web/API/Element/closest), followed by a CSS selector, \nwhich will find the closest ancestor element or itself, that matches the given CSS selector (e.g. `closest tr`);",
93 "description-sections": {
94 "Inheritance": "Use the :inherited modifier (e.g., `hx-indicator:inherited`) to make this attribute inherit to child elements"
95 },
96 "doc-url": "https://htmx.org/attributes/hx-indicator/"
97 },
98 {
99 "name": "hx-method",
100 "description": "The `hx-method` attribute specifies the HTTP method to use for a request. This attribute should be used with `hx-action` to specify the URL.\n\n```html\n<button hx-method=\"POST\" hx-action=\"/api/data\">\n Submit\n</button>\n```\n\nValid values are: GET, POST, PUT, PATCH, DELETE\n\nThis provides an alternative to the verb-specific attributes like `hx-get`, `hx-post`, etc.",
101 "doc-url": "https://htmx.org/attributes/hx-method/"
102 },
103 {
104 "name": "hx-on",
105 "pattern": {
106 "or": [
107 {
108 "items": [
109 "/js/events"
110 ],
111 "template": [
112 "hx-on:",
113 "#...",
114 "#item:JS event"
115 ]
116 },
117 {
118 "items": [
119 "/js/htmx-events"
120 ],
121 "template": [
122 "hx-on::",
123 "#...",
124 "#item:HTMX event"
125 ]
126 }
127 ]
128 },
129 "description": "The `hx-on*` attributes allow you to embed scripts inline to respond to events directly on an element; similar to the \n[`onevent` properties](https://developer.mozilla.org/en-US/docs/Web/Events/Event_handlers#using_onevent_properties) found in HTML, such as `onClick`.\n\nThe `hx-on*` attributes improve upon `onevent` by enabling the handling of any arbitrary JavaScript event,\nfor enhanced [Locality of Behaviour (LoB)](/essays/locality-of-behaviour/) even when dealing with non-standard DOM events. For example, these\nattributes allow you to handle [htmx events](/reference#events).",
130 "description-sections": {},
131 "doc-url": "https://htmx.org/attributes/hx-on/"
132 },
133 {
134 "name": "hx-patch",
135 "description": "The `hx-patch` attribute will cause an element to issue a `PATCH` to the specified URL and swap\nthe HTML into the DOM using a swap strategy:\n\n```html\n<button hx-patch=\"/account\" hx-target=\"body\">\n Patch Your Account\n</button>\n```",
136 "doc-url": "https://htmx.org/attributes/hx-patch/"
137 },
138 {
139 "name": "hx-post",
140 "description": "The `hx-post` attribute will cause an element to issue a `POST` to the specified URL and swap\nthe HTML into the DOM using a swap strategy:\n\n```html\n<button hx-post=\"/account/enable\" hx-target=\"body\">\n Enable Your Account\n</button>\n```",
141 "doc-url": "https://htmx.org/attributes/hx-post/"
142 },
143 {
144 "name": "hx-preserve",
145 "description": "The `hx-preserve` attribute allows you to keep an element unchanged during HTML replacement.\nElements with `hx-preserve` set are preserved by `id` when htmx updates any ancestor element.\nYou *must* set an unchanging `id` on elements for `hx-preserve` to work.\nThe response requires an element with the same `id`, but its type and other attributes are ignored.",
146 "doc-url": "https://htmx.org/attributes/hx-preserve/"
147 },
148 {
149 "name": "hx-push-url",
150 "description": "The `hx-push-url` attribute allows you to push a URL into the browser [location history](https://developer.mozilla.org/en-US/docs/Web/API/History_API).\nThis creates a new history entry, allowing navigation with the browser's back and forward buttons.\nhtmx snapshots the current DOM and saves it into its history cache, and restores from this cache on navigation.\n\nThe possible values of this attribute are:\n\n1. `true`, which pushes the fetched URL into history.\n2. `false`, which disables pushing the fetched URL if it would otherwise be pushed due to inheritance or [`hx-boost`](/attributes/hx-boost).\n3. A URL to be pushed into the location bar.\n This may be relative or absolute, as per [`history.pushState()`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState).",
151 "description-sections": {
152 "Inheritance": "Use the :inherited modifier (e.g., `hx-push-url:inherited`) to make this attribute inherit to child elements"
153 },
154 "doc-url": "https://htmx.org/attributes/hx-push-url/"
155 },
156 {
157 "name": "hx-put",
158 "description": "The `hx-put` attribute will cause an element to issue a `PUT` to the specified URL and swap\nthe HTML into the DOM using a swap strategy:\n\n```html\n<button hx-put=\"/account\" hx-target=\"body\">\n Put Money In Your Account\n</button>\n```",
159 "doc-url": "https://htmx.org/attributes/hx-put/"
160 },
161 {
162 "name": "hx-replace-url",
163 "description": "The `hx-replace-url` attribute allows you to replace the current url of the browser [location history](https://developer.mozilla.org/en-US/docs/Web/API/History_API).\n\nThe possible values of this attribute are:\n\n1. `true`, which replaces the fetched URL in the browser navigation bar.\n2. `false`, which disables replacing the fetched URL if it would otherwise be replaced due to inheritance.\n3. A URL to be replaced into the location bar.\n This may be relative or absolute, as per [`history.replaceState()`](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState).",
164 "description-sections": {
165 "Inheritance": "Use the :inherited modifier (e.g., `hx-replace-url:inherited`) to make this attribute inherit to child elements"
166 },
167 "doc-url": "https://htmx.org/attributes/hx-replace-url/"
168 },
169 {
170 "name": "hx-select-oob",
171 "description": "The `hx-select-oob` attribute allows you to select content from a response to be swapped in via an out-of-band swap. \nThe value of this attribute is comma separated list of elements to be swapped out of band. This attribute is almost\nalways paired with [hx-select](@/attributes/hx-select.md).\n\nHere is an example that selects a subset of the response content:\n\n```html\n<div>\n <div id=\"alert\"></div>\n <button hx-get=\"/info\" \n hx-select=\"#info-details\" \n hx-swap=\"outerHTML\"\n hx-select-oob=\"#alert\">\n Get Info!\n </button>\n</div>\n```",
172 "description-sections": {
173 "Inheritance": "Use the :inherited modifier (e.g., `hx-select-oob:inherited`) to make this attribute inherit to child elements"
174 },
175 "doc-url": "https://htmx.org/attributes/hx-select-oob/"
176 },
177 {
178 "name": "hx-select",
179 "description": "The `hx-select` attribute allows you to select the content you want swapped from a response. The value of\nthis attribute is a CSS query selector of the element or elements to select from the response.\n\nHere is an example that selects a subset of the response content:\n\n```html\n<div>\n <button hx-get=\"/info\" hx-select=\"#info-detail\" hx-swap=\"outerHTML\">\n Get Info!\n </button>\n</div>\n```",
180 "description-sections": {
181 "Inheritance": "Use the :inherited modifier (e.g., `hx-select:inherited`) to make this attribute inherit to child elements"
182 },
183 "doc-url": "https://htmx.org/attributes/hx-select/"
184 },
185 {
186 "name": "hx-swap-oob",
187 "description": "The `hx-swap-oob` attribute allows you to specify that some content in a response should be\nswapped into the DOM somewhere other than the target, that is \"Out of Band\". This allows you to piggyback updates to other element updates on a response.\n\nConsider the following response HTML:\n\n```html\n<div>\n ...\n</div>\n<div id=\"alerts\" hx-swap-oob=\"true\">\n Saved!\n</div>",
188 "doc-url": "https://htmx.org/attributes/hx-swap-oob/"
189 },
190 {
191 "name": "hx-swap",
192 "description": "The `hx-swap` attribute allows you to specify how the response will be swapped in relative to the\n[target](@/attributes/hx-target.md) of an AJAX request. If you do not specify the option, the default is\n`htmx.config.defaultSwapStyle` (`innerHTML`).\n\nThe possible values of this attribute are:\n\n* `innerHTML` - Replace the inner html of the target element\n* `outerHTML` - Replace the entire target element with the response\n* `textContent` - Replace the text content of the target element, without parsing the response as HTML\n* `beforebegin` - Insert the response before the target element\n* `afterbegin` - Insert the response before the first child of the target element\n* `beforeend` - Insert the response after the last child of the target element\n* `afterend` - Insert the response after the target element\n* `delete` - Deletes the target element regardless of the response\n* `none`- Does not append content from response (out of band items will still be processed).\n* `morph` - Morphs the target element with the response (requires morphing extension or built-in morphing)\n* `morph:outerHTML` - Morphs the outer HTML of the target element\n* `morph:innerHTML` - Morphs the inner HTML of the target element",
193 "description-sections": {
194 "Inheritance": "Use the :inherited modifier (e.g., `hx-swap:inherited`) to make this attribute inherit to child elements"
195 },
196 "doc-url": "https://htmx.org/attributes/hx-swap/"
197 },
198 {
199 "name": "hx-sync",
200 "description": "The `hx-sync` attribute allows you to synchronize AJAX requests between multiple elements.\n\nThe `hx-sync` attribute consists of a CSS selector to indicate the element to synchronize on, followed optionally\nby a colon and then by an optional syncing strategy. The available strategies are:\n\n* `drop` - drop (ignore) this request if an existing request is in flight (the default)\n* `abort` - drop (ignore) this request if an existing request is in flight, and, if that is not the case, \n *abort* this request if another request occurs while it is still in flight\n* `replace` - abort the current request, if any, and replace it with this request\n* `queue` - place this request in the request queue associated with the given element",
201 "description-sections": {
202 "Inheritance": "Use the :inherited modifier (e.g., `hx-sync:inherited`) to make this attribute inherit to child elements"
203 },
204 "doc-url": "https://htmx.org/attributes/hx-sync/"
205 },
206 {
207 "name": "hx-target",
208 "description": "The `hx-target` attribute allows you to target a different element for swapping than the one issuing the AJAX\nrequest. The value of this attribute can be:\n\n* A CSS query selector of the element to target.\n* `this` which indicates that the element that the `hx-target` attribute is on is the target.\n* `closest <CSS selector>` which will find the [closest](https://developer.mozilla.org/docs/Web/API/Element/closest)\n ancestor element or itself, that matches the given CSS selector\n* `find <CSS selector>` which will find the first child descendant element that matches the given CSS selector.\n* `next` which resolves to [element.nextElementSibling](https://developer.mozilla.org/docs/Web/API/Element/nextElementSibling)\n* `next <CSS selector>` which will scan the DOM forward for the first element that matches the given CSS selector.\n* `previous` which resolves to [element.previousElementSibling](https://developer.mozilla.org/docs/Web/API/Element/previousElementSibling)\n* `previous <CSS selector>` which will scan the DOM backwards for the first element that matches the given CSS selector.",
209 "description-sections": {
210 "Inheritance": "Use the :inherited modifier (e.g., `hx-target:inherited`) to make this attribute inherit to child elements"
211 },
212 "doc-url": "https://htmx.org/attributes/hx-target/"
213 },
214 {
215 "name": "hx-trigger",
216 "description": "The `hx-trigger` attribute allows you to specify what triggers an AJAX request. A trigger\nvalue can be one of the following:\n\n* An event name (e.g. \"click\" or \"my-custom-event\") followed by an event filter and a set of event modifiers\n* A polling definition of the form `every <timing declaration>`\n* A comma-separated list of such events",
217 "doc-url": "https://htmx.org/attributes/hx-trigger/"
218 },
219 {
220 "name": "hx-validate",
221 "description": "The `hx-validate` attribute will cause an element to validate itself by way of the [HTML5 Validation API](@/docs.md#validation)\nbefore it submits a request.\n\nOnly `<form>` elements validate data by default, but other elements do not. Adding `hx-validate=\"true\"` to `<input>`, `<textarea>` or `<select>` enables validation before sending requests.",
222 "doc-url": "https://htmx.org/attributes/hx-validate/"
223 },
224 {
225 "name": "hx-vals",
226 "description": "The `hx-vals` attribute allows you to add to the parameters that will be submitted with an AJAX request.\n\nBy default, the value of this attribute is a list of name-expression values in [JSON (JavaScript Object Notation)](https://www.json.org/json-en.html)\nformat.\n\nIn htmx 4, you can use the `js:` prefix to evaluate JavaScript expressions:\n\n```html\n<button hx-post=\"/api/data\" hx-vals='js:{token: getAuthToken()}'>\n Submit\n</button>\n```",
227 "description-sections": {
228 "Inheritance": "Use the :inherited modifier (e.g., `hx-vals:inherited`) to make this attribute inherit to child elements"
229 },
230 "doc-url": "https://htmx.org/attributes/hx-vals/"
231 },
232 {
233 "name": "hx-sse:connect",
234 "description": "Establishes a persistent SSE connection to the specified URL. Requires the SSE extension.\n\nDefaults to trigger on `load`, auto-reconnect with exponential backoff, and pause on background tab.\n\n```html\n<div hx-sse:connect=\"/stream\" hx-swap=\"beforeend\">\n Messages appear here\n</div>\n```",
235 "doc-url": "https://htmx.org/extensions/sse/#hx-sseconnect"
236 },
237 {
238 "name": "hx-sse:close",
239 "description": "Closes an SSE connection when a named event matching the attribute value is received from the server.\n\n```html\n<div hx-sse:connect=\"/stream\" hx-sse:close=\"done\">\n Streaming until server sends \"done\"...\n</div>\n```",
240 "doc-url": "https://htmx.org/extensions/sse/#hx-sseclose"
241 }
242 ]
243 },
244 "css": {
245 "classes": [
246 {
247 "name": "htmx-added",
248 "description": "Applied to a new piece of content before it is swapped, removed after it is settled.",
249 "doc-url": "https://htmx.org/reference/#classes"
250 },
251 {
252 "name": "htmx-indicator",
253 "description": "A dynamically generated class that will toggle visible (opacity:1) when a `htmx-request` class is present",
254 "doc-url": "https://htmx.org/reference/#classes"
255 },
256 {
257 "name": "htmx-request",
258 "description": "Applied to either the element or the element specified with [`hx-indicator`](@/attributes/hx-indicator.md) while a request is ongoing",
259 "doc-url": "https://htmx.org/reference/#classes"
260 },
261 {
262 "name": "htmx-settling",
263 "description": "Applied to a target after content is swapped, removed after it is settled. The duration can be modified via [`hx-swap`](@/attributes/hx-swap.md).",
264 "doc-url": "https://htmx.org/reference/#classes"
265 },
266 {
267 "name": "htmx-swapping",
268 "description": "Applied to a target before any content is swapped, removed after it is swapped. The duration can be modified via [`hx-swap`](@/attributes/hx-swap.md).",
269 "doc-url": "https://htmx.org/reference/#classes"
270 }
271 ]
272 },
273 "js": {
274 "events": [
275 {
276 "name": "HTMX event",
277 "pattern": {
278 "items": [
279 "/js/htmx-events"
280 ],
281 "template": [
282 "htmx:",
283 "$...",
284 "#item:HTMX event"
285 ]
286 }
287 }
288 ],
289 "htmx-events": [
290 {
291 "name": "abort",
292 "description": "This event is different than other events: htmx does not *trigger* it, but rather *listens* for it.\n\nIf you send an `htmx:abort` event to an element making a request, it will abort the request:\n\n```html\n<button id=\"request-button\" hx-post=\"/example\">Issue Request</button>\n<button onclick=\"htmx.trigger('#request-button', 'htmx:abort')\">Cancel Request</button>\n```",
293 "doc-url": "https://htmx.org/events/#htmx:abort"
294 },
295 {
296 "name": "after:cleanup",
297 "description": "This event is triggered after htmx has cleaned up an element.\n\n##### Details\n\n* `detail.elt` - the element that was cleaned up",
298 "doc-url": "https://htmx.org/events/#htmx:after:cleanup"
299 },
300 {
301 "name": "after:history:update",
302 "description": "This event is triggered after a history update has occurred.\n\n##### Details\n\n* `detail.path` - the path that was pushed or replaced in history",
303 "doc-url": "https://htmx.org/events/#htmx:after:history:update"
304 },
305 {
306 "name": "after:init",
307 "description": "This event is triggered after htmx has initialized a DOM node.\n\n##### Details\n\n* `detail.elt` - the element that was initialized",
308 "doc-url": "https://htmx.org/events/#htmx:after:init"
309 },
310 {
311 "name": "after:process",
312 "description": "This event is triggered after htmx has processed an element.\n\n##### Details\n\n* `detail.elt` - the element that was processed",
313 "doc-url": "https://htmx.org/events/#htmx:after:process"
314 },
315 {
316 "name": "after:history:push",
317 "description": "This event is triggered after a URL has been pushed into history.\n\n##### Details\n\n* `detail.path` - the path that was pushed into history",
318 "doc-url": "https://htmx.org/events/#htmx:after:history:push"
319 },
320 {
321 "name": "after:history:replace",
322 "description": "This event is triggered after a URL has been replaced in history.\n\n##### Details\n\n* `detail.path` - the path that was replaced in history",
323 "doc-url": "https://htmx.org/events/#htmx:after:history:replace"
324 },
325 {
326 "name": "after:request",
327 "description": "This event is triggered after an AJAX request has finished.\n\n##### Details\n\n* `detail.ctx` - the request context",
328 "doc-url": "https://htmx.org/events/#htmx:after:request"
329 },
330 {
331 "name": "after:settle",
332 "description": "This event is triggered after content has settled.\n\n##### Details\n\n* `detail.ctx` - the request context",
333 "doc-url": "https://htmx.org/events/#htmx:after:settle"
334 },
335 {
336 "name": "after:sse:connection",
337 "description": "This event is triggered after a successful SSE connection or reconnection.\n\n##### Details\n\n* `detail.connection.attempt` - attempt number (0 = initial)\n* `detail.connection.url` - the URL connected to\n* `detail.connection.status` - the HTTP status code\n* `detail.connection.lastEventId` - the last event ID received (null on initial)",
338 "doc-url": "https://htmx.org/extensions/sse/#events"
339 },
340 {
341 "name": "after:sse:message",
342 "description": "This event is triggered after an SSE message has been processed.\n\n##### Details\n\n* `detail.message` - the SSE message object",
343 "doc-url": "https://htmx.org/extensions/sse/#events"
344 },
345 {
346 "name": "after:swap",
347 "description": "This event is triggered after new content has been swapped into the DOM.\n\n##### Details\n\n* `detail.ctx` - the request context",
348 "doc-url": "https://htmx.org/events/#htmx:after:swap"
349 },
350 {
351 "name": "after:viewTransition",
352 "description": "This event is triggered after a view transition has completed.\n\n##### Details\n\n* `detail.ctx` - the request context",
353 "doc-url": "https://htmx.org/events/#htmx:after:viewTransition"
354 },
355 {
356 "name": "before:cleanup",
357 "description": "This event is triggered before htmx cleans up an element.\n\n##### Details\n\n* `detail.elt` - the element about to be cleaned up",
358 "doc-url": "https://htmx.org/events/#htmx:before:cleanup"
359 },
360 {
361 "name": "before:history:update",
362 "description": "This event is triggered before a history update is performed.\n\n##### Details\n\n* `detail.history` - the history update information (path and type)",
363 "doc-url": "https://htmx.org/events/#htmx:before:history:update"
364 },
365 {
366 "name": "before:init",
367 "description": "This event is triggered before htmx initializes a DOM node.\n\n##### Details\n\n* `detail.elt` - the element about to be initialized",
368 "doc-url": "https://htmx.org/events/#htmx:before:init"
369 },
370 {
371 "name": "before:process",
372 "description": "This event is triggered before htmx processes an element.\n\n##### Details\n\n* `detail.elt` - the element about to be processed",
373 "doc-url": "https://htmx.org/events/#htmx:before:process"
374 },
375 {
376 "name": "before:request",
377 "description": "This event is triggered before an AJAX request is issued. If you call `preventDefault()`, the request will be cancelled.\n\n##### Details\n\n* `detail.ctx` - the request context",
378 "doc-url": "https://htmx.org/events/#htmx:before:request"
379 },
380 {
381 "name": "before:response",
382 "description": "This event is triggered after a fetch response is received but before the response body is consumed. Extensions can intercept the raw response here (e.g., for streaming). If you call `preventDefault()`, normal response processing will be skipped.\n\n##### Details\n\n* `detail.ctx` - the request context with `ctx.response.raw` containing the unconsumed Response object",
383 "doc-url": "https://htmx.org/events/#htmx:before:response"
384 },
385 {
386 "name": "before:history:restore",
387 "description": "This event is triggered before history is restored.\n\n##### Details\n\n* `detail.path` - the path being restored",
388 "doc-url": "https://htmx.org/events/#htmx:before:history:restore"
389 },
390 {
391 "name": "before:settle",
392 "description": "This event is triggered before the settle phase begins.\n\n##### Details\n\n* `detail.ctx` - the request context",
393 "doc-url": "https://htmx.org/events/#htmx:before:settle"
394 },
395 {
396 "name": "before:sse:connection",
397 "description": "This event is triggered before an SSE connection attempt (initial or reconnection). Set detail.connection.cancelled = true to prevent.\n\n##### Details\n\n* `detail.connection.attempt` - attempt number (0 = initial)\n* `detail.connection.delay` - delay before connection (ms)\n* `detail.connection.url` - the URL being connected to\n* `detail.connection.lastEventId` - the last event ID received (null on initial)\n* `detail.connection.cancelled` - set to true to cancel",
398 "doc-url": "https://htmx.org/extensions/sse/#events"
399 },
400 {
401 "name": "before:sse:message",
402 "description": "This event is triggered before an SSE message is processed. Set detail.message.cancelled = true to skip.\n\n##### Details\n\n* `detail.message` - the SSE message object",
403 "doc-url": "https://htmx.org/extensions/sse/#events"
404 },
405 {
406 "name": "sse:error",
407 "description": "This event is triggered when an SSE stream error occurs.\n\n##### Details\n\n* `detail.error` - the error object",
408 "doc-url": "https://htmx.org/extensions/sse/#events"
409 },
410 {
411 "name": "sse:close",
412 "description": "This event is triggered when an SSE connection is closed.\n\n##### Details\n\n* `detail.reason` - why the connection was closed (\"message\", \"removed\", \"ended\", \"cancelled\", \"cleanup\")",
413 "doc-url": "https://htmx.org/extensions/sse/#events"
414 },
415 {
416 "name": "before:swap",
417 "description": "This event is triggered before new content is swapped into the DOM. If you call `preventDefault()`, no swap will occur.\n\n##### Details\n\n* `detail.ctx` - the request context\n* `detail.tasks` - the swap tasks to be performed",
418 "doc-url": "https://htmx.org/events/#htmx:before:swap"
419 },
420 {
421 "name": "before:viewTransition",
422 "description": "This event is triggered before a view transition occurs. If you call `preventDefault()`, the view transition will not occur.\n\n##### Details\n\n* `detail.ctx` - the request context",
423 "doc-url": "https://htmx.org/events/#htmx:before:viewTransition"
424 },
425 {
426 "name": "config:request",
427 "description": "This event is triggered when a request is being configured. You can modify the request parameters, headers, etc.\n\n##### Details\n\n* `detail.ctx` - the request context",
428 "doc-url": "https://htmx.org/events/#htmx:config:request"
429 },
430 {
431 "name": "confirm",
432 "description": "This event is triggered when a confirmation is required. If you call `preventDefault()`, the request will not be issued.\n\n##### Details\n\n* `detail.ctx` - the request context\n* `detail.issueRequest` - function to call to issue the request",
433 "doc-url": "https://htmx.org/events/#htmx:confirm"
434 },
435 {
436 "name": "error",
437 "description": "This event is triggered when any error occurs (network errors, swap errors, etc).\n\n##### Details\n\n* `detail.ctx` - the request context\n* `detail.error` - the error that occurred",
438 "doc-url": "https://htmx.org/events/#htmx:error"
439 },
440 {
441 "name": "finally:request",
442 "description": "This event is always triggered after a request completes, whether successful or not.\n\n##### Details\n\n* `detail.ctx` - the request context",
443 "doc-url": "https://htmx.org/events/#htmx:finally:request"
444 }
445 ]
446 }
447 }
448 }