A curated collection of Zed editor snippets Zed to speed up development with HTMX.
- Open Zed.
- Go to:
Settings β Snippets βhtmx-snippets.json
. - Copy & paste the snippets from this repo into your
htmx-snippets.json
. - Save & reload Zed.
Now type a prefix (likehx-post
) and hit Tab to expand.
Prefix | Description |
---|---|
hx-get |
Issue a GET request |
hx-post |
Issue a POST request |
hx-put |
Issue a PUT request |
hx-delete |
Issue a DELETE request |
hx-patch |
Issue a PATCH request |
hx-trigger |
Define an event trigger |
hx-target |
Specify response target |
hx-swap |
Control how content swaps (innerHTML , outerHTML , etc.) |
hx-select |
Select subset of response to swap in |
hx-select-oob |
Out-of-band swap |
hx-vals |
Send extra values with request |
hx-include |
Include another elementβs values |
hx-params |
Control which params are submitted |
hx-confirm |
Confirmation dialog before request |
hx-disable |
Disable HTMX on an element |
hx-boost |
Turn links/forms into AJAX |
hx-preserve |
Preserve element across swaps |
hx-replace-url |
Replace browser URL |
hx-push-url |
Push URL into history |
hx-history |
Control history cache behavior |
hx-indicator |
Show loading indicator |
hx-sync |
Coordinate multiple requests |
hx-ext |
Enable HTMX extension |
hx-example-button |
Example HTMX button (post + target + swap) |