htmx 4.0 is under construction — migration guide

htmx.config.requestClass

CSS class applied during requests

The htmx.config.requestClass option sets the CSS class automatically applied to the element making a request.

Default: "htmx-request"

Example

htmx.config.requestClass = "is-loading";
<meta name="htmx-config" content='{"requestClass":"is-loading"}'>

Use this class to style elements while they’re making requests.