---
title: "💭 </> htmx ~ hx-indicator Attribute"
description: "!https://htmx.org/attributes/hx-indicator/"
date: 2023-09-02
published: true
tags:
  - htmx
  - webdev
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://htmx.org/attributes/hx-indicator/" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-content">
      <div class="embed-card-title">&lt;/&gt; htmx ~ hx-indicator Attribute</div>
      <div class="embed-card-description">The hx-indicator attribute in htmx allows you to specify the element that will have the `htmx-request` class added to it for the duration of the request. This can be used to show spinners or progre...</div>
      <div class="embed-card-meta">htmx.org</div>
    </div>
  </a>
</div>


The `htmx-request` class is added to `htmx-target` elements.  You can target this css selector to create  loading state throbbers.

By default the target element will the `self`, but you can use the typical htmx css selector to select which element will recieve the `htmx-request` class while the request is running.

The only way to override the name of the class is through config.

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
