Spec-Zone.ru › htmx

htmx.config.requestClass

Sets class applied during requests

The htmx.config.requestClass option sets the CSS class htmx adds while a request is running.

htmx adds it to the element selected by hx-indicator. Without hx-indicator, htmx adds it to the request source.

Default: "htmx-request"

Syntax

Use a custom request-state class:

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

htmx removes the class when the request ends.

See Also

  • hx-indicator
  • htmx.config.includeIndicatorCSS
  • htmx.config.indicatorClass

Licensed under the Zero-Clause BSD License.
https://four.htmx.org/reference/config/htmx-config-requestClass/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API