Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

htmx

485 sites Security covered
View on drupal.org

HTMX in Drupal Core!

HTMX was added as a dependency to Drupal on in 11.2 as part of the Replace AJAX API with HTMX community initiative. A full featured integration is now in Drupal 11.3.

This module will transition to provide extra tools and support for using the HTMX integration found in core.

htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext

htmx is small (~14k min.gz’d), dependency-free, extendable, IE11 compatible & has reduced code base sizes by 67% when compared with react

By removing these arbitrary constraints, htmx completes HTML as a hypertext

    <button data-hx-get="/htmx/blocks/add/announce_block"
            data-hx-target="#drupal-off-canvas-wrapper"
            data-hx-select="#drupal-off-canvas-wrapper"
            data-hx-swap="outerHTML ignoreTitle:true" class="button">
        Add
    </button>

The data-hx-get and data-hx-select attributes on this button tell htmx:
“When a user clicks on this button, issue an GET request to /htmx/blocks/add/announce_block, and select from the response the content with id drupal-off-canvas-wrapper”
The data-hx-target and data-hx-swap attributes tell htmx:
"Replace the existing content with id drupal-off-canvas-wrapper with the selected content."

Watch a recent session on HTMX in Drupal

For developers

We provide an easy developer experience in a fully documented class for assembling your HTMX attributes. Here's how we built the render array for the button described above:

$row['operations']['data'] = [
  '#type' => 'button',
  '#value' => 'Add',
  '#attributes' => [
    'class' => ['button'],
  ],
 ];

 $htmxAddButton = new HtmxAttribute($row['operations']['data']['#attributes']);
 $htmxAddButton->get(Url::fromRoute('entity.htmx_block.add_form', ['plugin_id' => $plugin_id]))
  ->target('#drupal-off-canvas-wrapper')
  ->select('#drupal-off-canvas-wrapper')
  ->swap('outerHTML ignoreTitle:true');
 $row['operations']['data']['#attributes'] = $htmxAddButton->toArray();

Read about an admin interface we built in Drupal for a more in-depth introduction.

Full documentation is available in our documentation site and also included in the docs directory of the module.

Why do I want this over react or vue js?

Why you want to use htmx? Read this article about the "Rule of Least Power".

Hypermedia

Hypermedia is the basic architecture of the web. Learn more about this foundation and how HTMX aligns the hypermedia capabilities of HTML with HTTP in Hypermedia Systems

Activity

Total releases
15
First release
Jan 2025
Latest release
1 month ago
Release cadence
34 days
Stability
47% stable

Release Timeline

Releases

Version Type Release date
2.0.0-rc1 Pre-release Apr 30, 2026
2.0.0-beta2 Pre-release Jan 9, 2026
2.0.0-beta1 Pre-release Jan 9, 2026
2.x-dev Dev Jan 9, 2026
1.5.2 Stable Dec 11, 2025
1.5.1 Stable Nov 26, 2025
1.6.x-dev Dev Oct 23, 2025
1.5.0 Stable Aug 30, 2025
1.5.0-beta1 Pre-release Aug 7, 2025
1.4.3 Stable Jul 20, 2025
1.5.x-dev Dev Jun 14, 2025
1.4.2 Stable Jun 14, 2025
1.4.1 Stable Mar 28, 2025
1.4.0 Stable Feb 15, 2025
1.4.0-beta4 Pre-release Jan 15, 2025