HTMX 2 was added to Drupal 11.3.x. View on Drupal.org #3555916 HTMX 4 is coming in Drupal 12 Status: Closed (fixed).
https://drupalpatterns.shawnduncan.org/post/drupal-12-and-htmx-4
How it works
Adding this url argument tells drupal to deliver an HTMX response, which is the requested page's main content.
?_wrapper_format=drupal_htmx
For example, add this to your page.html.twig template.
<button
hx-get="/node/1?_wrapper_format=drupal_htmx"
hx-target="#content-container"
>Click me</button>
<div id="content-container"></div>Clicking the button will load content from node 1 and insert it in the container.
These headers are included in the request when you click on the button:
HX-Request: true
HX-Target: dialog-container
HX-Current-URL: https://drupal11.ddev.site/Follow along
The current development plan.
HTMX
Drupal 11: Making Interactive Elements With HTMX
Intro to drupal htmx.
Replace AJAX API with HTMX
Community initiative page.
View on Drupal.org #3404409 [Plan] Gradually replace Drupal's AJAX system with HTMX Status: Active
Top level issue for the upgrade.
View on Drupal.org #3555916 Update to htmx 4 Status: Closed (fixed)
Latest version compatibility, happening in Drupal 12. Almost ready.
jQuery/Ajax
View on Drupal.org #3052002 [meta] Replace JQuery with vanilla Javascript in core Status: Active
AJAX API uses jQuery. Need to convert to vanilla JS so we can remove it.
View on Drupal.org #3189416 [PP-x] Remove jQuery Form dependency from misc/ajax.js Status: Postponed
Superseded by HTMX upgrade.
View on GitLab #3535179 [Plan] Provide guidance for refactoring existing Ajax API commands Status: Active
List of AJAX API commands, which all need replacement.
View on Drupal.org #3176441 JavaScript event handling without a full jQuery dependency Status: Needs work
Need a way to call events from other scripts.
Views
View on Drupal.org #3548100 [PoC] Use HTMX for (some?) ajax views Status: Needs work
Refresh view from pagers, filters, sorts.
Dialog/Modal
Replace jQuery UI dialog that was driven with Ajax commands.
New system will be driven by server side htmx responses.
A simple View on Drupal.org #2158943 web component was proposed by @latent Status: Needs review.
View on GitLab #3546797 Implement OpenModalDialogCommand in htmx Status: Active
OpenModalDialogCommand
One of the big things from the jQuery/AJAX API.
View on Drupal.org #1842040 [meta] Decide on where to use modal dialogs Status: Active
Old issue for enhancing the admin UI with dialogs.
View on Drupal.org #1842036 [META] Convert all confirm forms to use modal dialog Status: Active
UX upgrade using new API.
Drupal Slack #HTMX - Replace jQuery dialog 7/27/26
Slack discussion on new modal/dialog for htmx.
Suggestion to use a dialog web component.
View on Drupal.org #2158943 Add a native dialog element to deprecate the jQuery UI dialog Status: Needs review
New dialog system, built with HTMX.
My Issues
Need a way to specify where the window scrolls when a swap happens.
For example, when a pager is clicked on a view, scroll to the top of the view/results.
Can we come up with a one size fits all rule, or do we need a way to customize in the view?
The AJAX API had a simple way to make a link load a page or form into a modal. Forms and links are automatically altered to have sensible behavior in the modal. For example, submitting the form over ajax and closing the modal.