What is the HTMX Library?

Estimated reading: 1 minute

htmx is a library that allows you to access modern browser features directly from HTML, rather than using JavaScript.

As Toolbox is heavily focused towards Twig templates and Timber for the WordPress implementation of that, htmx is something that can be used to trigger AJAX loads, reloads, replacements, appending, prepending and much, much, more. By simply adding HTML tags in your Twig template, combined with attributes for directives, you can do push the boundaries of what can be done using a single Twig template even further.

To allow you to not only place the call, Toolbox at the same time allows you to register an AJAX answer by adding headers to a Twig template. Toolbox picks up on the header, and when calling the AJAX action, parses the template to output the rendered HTML.

Activate the HTMX library

htmx is a JavaScript library that only needs to be enqueued. You can do that by going to the “Settings > Toolbox > 3rd party CSS/JS” panel on your WordPress Dashboard, selecting the checkbox and click “update settings”.

Share this Doc

What is the HTMX Library?

Or copy link