Skip to content

Commit

Permalink
Adding example to hx-ext documentation (#3109)
Browse files Browse the repository at this point in the history
* Update hx-ext.md

* Update hx-ext.md

* Update www/content/attributes/hx-ext.md

Co-authored-by: Vincent <[email protected]>

* Update hx-ext.md

---------

Co-authored-by: Vincent <[email protected]>
  • Loading branch information
zachczx and Telroshan authored Jan 16, 2025
1 parent 5fd60a5 commit d890547
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions www/content/attributes/hx-ext.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title = "hx-ext"

The `hx-ext` attribute enables an htmx [extension](https://htmx.org/extensions) for an element and all its children.

The value can be a single extension name or a comma separated list of extensions to apply.
The value can be a single extension name or a comma-separated list of extensions to apply.

The `hx-ext` tag may be placed on parent elements if you want a plugin to apply to an entire swath of the DOM,
and on the `body` tag for it to apply to all htmx requests.
Expand All @@ -25,4 +25,8 @@ hierarchy and it will apply to all child elements.
</div>
</div>
```

```html
<body hx-ext="preload,morph">
"preload" and "morph" extensions are used in this part of the tree...
</body>
```

0 comments on commit d890547

Please sign in to comment.