> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Loading indicator with Vue InstantSearch

> Learn how to display a loading indicator with Vue InstantSearch.

<div className="not-prose algolia-flavor-switcher">
  <div className="afs-dropdown">
    <div className="afs-trigger" role="button" tabIndex="0" aria-haspopup="listbox">
      <span className="afs-current">Vue</span>

      <svg className="afs-chevron lucide lucide-chevron-down" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
        <path d="m6 9 6 6 6-6" />
      </svg>
    </div>

    <ul className="afs-menu" role="listbox">
      <li role="option" aria-selected="false"><a className="afs-option" href="/doc/guides/building-search-ui/ui-and-ux-patterns/loading-indicator/js"><span className="afs-option-name">JavaScript</span><span className="afs-option-lib">InstantSearch.js</span></a></li>
      <li role="option" aria-selected="false"><a className="afs-option" href="/doc/guides/building-search-ui/ui-and-ux-patterns/loading-indicator/react"><span className="afs-option-name">React</span><span className="afs-option-lib">React InstantSearch</span></a></li>
      <li role="option" aria-selected="true"><a className="afs-option is-current" href="/doc/guides/building-search-ui/ui-and-ux-patterns/loading-indicator/vue"><span className="afs-option-name">Vue</span><span className="afs-option-lib">Vue InstantSearch</span></a></li>
    </ul>
  </div>
</div>

You can display a loading indicator to inform users on a slow connection that their search is still in progress.

Use InstantSearch's `status` indicator to decide when to show a loading indicator. The `status` can be one of the following:

* `loading`: The search is in progress.
* `stalled`: The search is in progress, but the response is taking longer than expected.
* `error`: The search failed.
* `idle`: The search succeeded.

Best practice is to display a loading indicator only when `status` is `stalled`, not during a standard (fast) search. Tweak the timing of the `stalled` status by setting the [`stalledSearchDelay`](/doc/api-reference/widgets/instantsearch/vue) option.

You can then use this condition to display a loading indicator:

```html Vue theme={"system"}
<template>
  <ais-state-results>
    <template v-slot="{ status }">
      <p v-show="status === 'stalled'">
        Loading search results
      </p>
    </template>
  </ais-state-results>
</template>
```

If you want the loading indicator to display as soon as the search starts, use the `loading` status in combination with `stalled`:

```html Vue theme={"system"}
<template>
  <ais-state-results>
    <template v-slot="{ status }">
      <p v-show="status === 'loading' || status === 'stalled'">
        Loading search results
      </p>
    </template>
  </ais-state-results>
</template>
```
