Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

HTMX Extras

5 sites Security covered Drupal 11 · not 10 Htmx ecosystem
View on drupal.org

This module adds lazy loading capabilities to your Drupal website, allowing content to load only when needed. It also enables HTMX-powered views for more interactive content display.

The HTMX Extras module adds some lazy loading functionality to your website.

Currently, these elements are implemented:

  • Lazy load entity: A template to lazily load an entity render
  • Lazy load route: A template to lazily load the contents of a given route
  • Search API lazy load row plugin: Renders your views lazily when they're revealed in the viewport (completely customizable, uses the "Lazy load entity"-template)
  • HTMX-powered views (see more below the examples)

More functionality will be added once the need arises, feel free to create a ticket if you have a use case that could fall under this module's scope.

For replacing Drupal's AJAX API with HTMX, we gladly refer to the excellent HTMX-project

Examples:

Entity

use Drupal\htmx_extras\Render\HtmxEntityPartial;

// ...

// From plain parameters:
$build = HtmxEntityPartial::fromParameters($entity_type, $entity_id)
          ->setViewMode($view_mode)
          ->setOption('language', $language)
          ->setHtmxParameter('trigger', 'intersect once')
          ->render();

// From an entity object, note that the language parameter is derived from the entity object and does not need to be set manually:
$build = HtmxEntityPartial::fromEntity($entity)
          ->setViewMode($view_mode)
          ->setHtmxParameter('trigger', 'load')
          ->render();

Route

use Drupal\htmx_extras\Render\HtmxRoutePartial;

// ...

$build = HtmxRoutePartial::fromRoute('my_module.route_name', ['parameter1' => 'value1'], ['language' => $language])
          ->setHtmxParameter('trigger', 'load')
          ->render();

HTMX-powered views

In 1.0.4, a big new feature called "HTMX views" was added.
This allows the webmaster to add a view that rivals the reactivity of full blown react apps, but with almost fully Drupal core-powered technologies.
It does use AlpineJS for small pieces (mainly updating the URL history in the browser).

This patch is needed for the pager to work properly: https://www.drupal.org/project/facets/issues/3008615

Full steps:

  1. Add a REST Export-display to your desired view
  2. Make sure to use the "Facets serializer"-display format and after applying the patch above, turn on "Display pager and results"
  3. Make sure to use 'fields' and only add the "Item ID"-search API field, and in the fields settings (under format) give it the alias, e.g. "id".
  4. Use the "Full"-pager and configure however many items per page you'd like to see
  5. Configure your view as necessary (filters, sorts, ..) but use normal facets (not the new views exposed facets from facets 3.x, these are currently not yet supported).
  6. Go to /admin/structure/htmx-view and create a new HTMX view
  7. Configure it as you'd like, remember to use the "id"-alias in the "Item ID"-field mapping

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
10
Tracked since
Oct 2025
Latest release
9 months ago
Releases (12 mo)
10 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
1.1.x-dev Dev 11 Nov 16, 2025
1.0.7 Stable 11 Nov 11, 2025
1.0.6 Stable 11 Nov 11, 2025
1.0.5 Stable 11 Nov 10, 2025
1.0.4 Stable 11 Nov 10, 2025
1.0.3 Stable 11 Nov 9, 2025
1.0.2 Stable 11 Nov 4, 2025
1.0.1 Stable 11 Nov 4, 2025
1.0.0 Stable 11 Oct 31, 2025
1.0.x-dev Dev 11 Oct 31, 2025