> For the complete documentation index, see [llms.txt](https://docs.fact-finder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fact-finder.com/webcomponents-overview/web-components-4.x./api/more-features/loading-spinner.md).

# Loading Spinner

Show request progress for common FactFinder actions.

## Documentation

### Loading Spinner

`ff-loading-spinner` is a lightweight visual indicator for pending actions. It responds to common events fired by FactFinder Web Components.

The spinner uses inexpensive CSS animations. It does not trigger layout or paint operations in Blink and Gecko browsers.

By default, it activates for these events:

* `search`
* `filter`
* `clearFilter`
* `sort`
* `advisor`

It deactivates automatically when the action completes.

For example, a search through `ff-searchbox` activates the spinner. It deactivates when FactFinder returns the response.

**Usage**

**Default mode**

After integrating `ff-communication` and `ff-searchbox`, add the spinner to the page:

```html
<ff-loading-spinner></ff-loading-spinner>
```

The spinner appears when FactFinder receives a search request. It hides again when the response arrives.

**Manual mode**

Manual mode prevents the spinner from subscribing to events. Enable it with the `manual` attribute.

Adding `manual` unsubscribes the element from all events. Removing it subscribes the element again.

You can also set the `manual` property to `true` or `false`. Control visibility with `is-active`, `show()`, or `hide()`.

Manual mode is not required when using the visibility API. Use it when default subscriptions could interrupt custom animation timing.

```html
<!-- Active, visible element -->
<ff-loading-spinner manual is-active></ff-loading-spinner>

<script>
/* Hiding the element */
document.querySelector("ff-loading-spinner").isActive = false;
</script>
```

Use manual mode with custom event handlers:

```html
<!-- Hidden element -->
<ff-loading-spinner manual></ff-loading-spinner>

<script>
/* Show the spinner from a custom callback */
document.addEventListener("custom-event", function () {
    const spinner = document.querySelector("ff-loading-spinner");
    spinner.show();
});
</script>
```

**Changing color**

Set `stroke-color` to any CSS color value.

```html
<!-- Using HEX -->
<ff-loading-spinner stroke-color="#0000ff"></ff-loading-spinner>

<!-- Using RGB -->
<ff-loading-spinner stroke-color="rgb(65, 180, 170)"></ff-loading-spinner>

<!-- Using HSL -->
<ff-loading-spinner stroke-color="hsl(120, 100%, 75%)"></ff-loading-spinner>
```

## Demo

Try the [Loading Spinner demo](https://search-web-components.fact-finder.de/demos/4.x/ff-loading-spinner).

## API code

### Properties

<details>

<summary>Properties</summary>

| Name                                            | Description                                                        |
| ----------------------------------------------- | ------------------------------------------------------------------ |
| **is-active** (Boolean, default: `false`)       | Shows and animates the element when set.                           |
| **stroke-color** (String, default: `"#4285F4"`) | CSS color applied to the spinning stroke.                          |
| **manual** (Boolean, default: `false`)          | Disables default event subscriptions. Control visibility manually. |

</details>

### Methods

<details>

<summary>Methods</summary>

| Name       | Description                                            |
| ---------- | ------------------------------------------------------ |
| **show()** | Shows the spinner. Equivalent to setting `is-active`.  |
| **hide()** | Hides the spinner. Equivalent to removing `is-active`. |

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fact-finder.com/webcomponents-overview/web-components-4.x./api/more-features/loading-spinner.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
