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

# Spinner

> Spinners communicate that work is in progress when content is loading, a request is processing, or the exact completion time is unknown.

![BEEQ Spinner component overview](https://mintcdn.com/beeq/Z4ffKipt5yZIDQUT/components/images/spinner/spinner-overview-light.svg?fit=max\&auto=format\&n=Z4ffKipt5yZIDQUT\&q=85\&s=9d577d4a2585a9e64ce6b1fdf349d231)

Spinner component overview

Spinners reassure people that the system is still working during loading, submitting, syncing, or processing states. Use them when work is active but the exact progress cannot be measured reliably.

> [!NOTE]
>
> Show a spinner only when the wait is noticeable, typically longer than one second. If progress can be measured, prefer a [progress bar](https://www.beeq.design/components/progress.md) instead.

## When to use

> [card]
>
> Use spinners when
>
> * The system is actively loading, submitting, or processing
> * The wait is long enough that users may wonder whether anything is happening
> * The duration is unknown or cannot be expressed reliably as a percentage
> * You need compact feedback inside a card, panel, dialog, or page section

> [card]
>
> Do not use spinners when
>
> * The task finishes almost instantly and no feedback is needed
> * Progress can be measured precisely and should be communicated with a progress bar
> * Several unrelated areas on the same page would spin at once and compete for attention
> * The animation would be decorative rather than meaningful status feedback

> [!TIP]
>
> Choose [`bq-progress`](https://www.beeq.design/components/progress) instead of `bq-spinner` when completion can be measured against a known total.

## Patterns

> [card] No label
>
> Use a spinner without text only when the surrounding UI already makes the loading context obvious.

> [card] Label below
>
> A strong default for standalone loading states because the message adds context without widening the layout.

> [card] Inline label
>
> Use `text-position="right"` or `text-position="left"` when the spinner needs to fit into a horizontal layout.

> [card] Label above
>
> Useful when the message should appear first in the reading order or fit a stacked composition.

> [card] Size variants
>
> Match the spinner size to the container: `small` for tight spaces, `medium` for most cases, `large` for prominent loading areas.

> [card] Custom icon
>
> Override the default loader using the `icon` slot when you need a different branded or contextual treatment.

## Anatomy

![BEEQ Spinner component anatomy](https://mintcdn.com/beeq/Z4ffKipt5yZIDQUT/components/images/spinner/spinner-anatomy-light.svg?fit=max\&auto=format\&n=Z4ffKipt5yZIDQUT\&q=85\&s=956c8d892dcd6601a2355dfaa32becae)

Spinner component anatomy

The spinner combines a rotating circular indicator with an optional label. Keep the message short and specific so people understand what is happening without reading a full sentence.

| Part | Element | Description |
| - | - | - |
| **1** | Spinner icon | The animated circular loader that signals ongoing activity |
| **2** | Progress | The emphasized segment that creates the motion cue and sense of rotation |
| **3** | Label | Optional text that clarifies what is loading, submitting, or processing |

## Design guidelines

Choose the spinner treatment that best explains the waiting state without adding noise.

![Add a label when context is unclear](https://www.beeq.design/components/images/spinner/spinner-label-guidance-light.svg)
![Add a label when context is unclear](https://www.beeq.design/components/images/spinner/spinner-label-guidance-dark.svg)

## Add a label when context is unclear

Use a short loading message when the spinner appears away from the triggering action or when the wait may last several seconds.

![Match the size to the surface](https://www.beeq.design/components/images/spinner/spinner-size-guidance-light.svg)
![Match the size to the surface](https://www.beeq.design/components/images/spinner/spinner-size-guidance-dark.svg)

## Match the size to the surface

Keep `small` for compact containers, `medium` for most component-level states, and `large` for prominent or page-level loading areas.

**1. Decide whether text is needed**

Omit the label only when nearby UI already explains what is loading. Otherwise, add a short task-oriented message.

**2. Choose the position**

Use `below` as the default for standalone loading states. Use `left` or `right` when the spinner needs to fit into a horizontal composition.

**3. Keep the message short**

Prefer specific labels such as "Loading invoices" or "Syncing changes" instead of long descriptions.

> [!NOTE]
>
> If you replace the default loader with the `icon` slot, you are also replacing the built-in loading status element. Make sure the surrounding UI still communicates that work is in progress.

## Usage

### Default

Use the default spinner when the surrounding UI already makes the loading context obvious and you do not need a custom size or icon.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-spinner></bq-spinner>
```

```jsx React icon="react" theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqSpinner } from "@beeq/react";

<BqSpinner />
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqSpinner } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqSpinner],
  template: `<bq-spinner></bq-spinner>`
})
export class AppComponent {}
```

```vue Vue icon="vuejs" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqSpinner } from "@beeq/vue";
</script>

<template>
  <BqSpinner />
</template>
```

> [!TIP]
>
> `size="medium"` is the default, so you only need to set the `size` property when you want a `small` or `large` spinner.

## Options

**Allowed `size` values:** `small`, `medium` (default), `large`.

**Allowed `text-position` values:** `none` (default), `left`, `right`, `above`, `below`.

### Small

Use the small spinner when space is limited and the loading state belongs to a compact surface.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-spinner size="small"></bq-spinner>
```

```jsx React icon="react" theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqSpinner } from "@beeq/react";

<BqSpinner size="small" />
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqSpinner } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqSpinner],
  template: `<bq-spinner size="small"></bq-spinner>`
})
export class AppComponent {}
```

```vue Vue icon="vuejs" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqSpinner } from "@beeq/vue";
</script>

<template>
  <BqSpinner size="small" />
</template>
```

### Large

Use `size="large"` for prominent loading states such as page-level waits, major panels, or longer-running tasks that need stronger visual emphasis.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-spinner size="large"></bq-spinner>
```

```jsx React icon="react" theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqSpinner } from "@beeq/react";

<BqSpinner size="large" />
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqSpinner } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqSpinner],
  template: `<bq-spinner size="large"></bq-spinner>`
})
export class AppComponent {}
```

```vue Vue icon="vuejs" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqSpinner } from "@beeq/vue";
</script>

<template>
  <BqSpinner size="large" />
</template>
```

### With label

Use `text-position` to control where the loading message appears relative to the spinner icon.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-spinner text-position="below">Loading invoices...</bq-spinner>
<bq-spinner text-position="above">Syncing changes...</bq-spinner>
<bq-spinner text-position="right">Submitting...</bq-spinner>
<bq-spinner text-position="left">Processing...</bq-spinner>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqSpinner } from "@beeq/react";

<>
  <BqSpinner textPosition="below">Loading invoices...</BqSpinner>
  <BqSpinner textPosition="above">Syncing changes...</BqSpinner>
  <BqSpinner textPosition="right">Submitting...</BqSpinner>
  <BqSpinner textPosition="left">Processing...</BqSpinner>
</>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqSpinner } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqSpinner],
  template: `
    <bq-spinner text-position="below">Loading invoices...</bq-spinner>
    <bq-spinner text-position="above">Syncing changes...</bq-spinner>
    <bq-spinner text-position="right">Submitting...</bq-spinner>
    <bq-spinner text-position="left">Processing...</bq-spinner>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqSpinner } from "@beeq/vue";
</script>

<template>
  <BqSpinner textPosition="below">Loading invoices...</BqSpinner>
  <BqSpinner textPosition="above">Syncing changes...</BqSpinner>
  <BqSpinner textPosition="right">Submitting...</BqSpinner>
  <BqSpinner textPosition="left">Processing...</BqSpinner>
</template>
```

### Custom icon

Use the `icon` slot when you need a different spinner icon treatment. Make sure the surrounding context still communicates that work is in progress.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-spinner size="large">
  <bq-icon name="spinner-gap-bold" slot="icon"></bq-icon>
</bq-spinner>
```

```jsx React icon="react" theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqIcon, BqSpinner } from "@beeq/react";

<BqSpinner size="large">
  <BqIcon name="spinner-gap-bold" slot="icon" />
</BqSpinner>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqIcon, BqSpinner } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqSpinner],
  template: `
    <bq-spinner size="large">
      <bq-icon name="spinner-gap-bold" slot="icon"></bq-icon>
    </bq-spinner>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqIcon, BqSpinner } from "@beeq/vue";
</script>

<template>
  <BqSpinner size="large">
    <BqIcon name="spinner-gap-bold" slot="icon" />
  </BqSpinner>
</template>
```

## Best practices

> [card]
>
> Do
>
> Keep the message short and specific, such as "Loading invoices" or "Submitting form."

> [card]
>
> Don't
>
> Do not use a spinner when the system can show real progress or an immediate result instead.

> [card]
>
> Do
>
> Match the size to the surface: `small` for compact containers, `medium` for standard sections, and `large` for prominent loading states.

> [card]
>
> Don't
>
> Do not place multiple unrelated spinners on the same page unless each one represents a clearly separate loading region.

> [card]
>
> Do
>
> Add a visible label when the spinner appears away from the action that triggered it, or when the wait may last several seconds.

> [card]
>
> Don't
>
> Do not use a spinner as a page-level blocker for instant operations. It creates unnecessary friction.

> [card]
>
> Do
>
> Use `text-position="below"` for standalone loading states where vertical layout is natural.

> [card]
>
> Don't
>
> Do not omit a label in contexts where the surrounding UI does not already make the loading operation obvious.

## Accessibility

* **Built-in loading indicator** — the default spinner includes a status element with an accessible loading label that assistive technology can announce. When `textPosition` is set to any value other than `"none"`, the visible label text is also available to screen readers. If you replace the default loader with the `icon` slot, you must test that the loading state is still communicated clearly in context.
* **Use meaningful status text when needed**: you should add a short visible label such as "Loading results..." when the spinner appears away from the triggering action or when the wait may last several seconds.
* **Keep the message task-oriented**: labels should describe the current action, such as "Syncing changes" or "Submitting form", instead of generic filler.
* **Be careful with motion changes**: setting `animation={false}` can make an active process look stalled, so you should stop the animation only when another clear status treatment explains that work is still ongoing. The spinner also stops animating by itself when the user's system asks for reduced motion (`prefers-reduced-motion: reduce`), so a visible label or other status text keeps the waiting state clear for those users.
* **Avoid competing announcements**: too many independent loading indicators can create noise for screen reader users and make it harder to understand which region is updating. You should not show several independent spinners at once.

### Keyboard interaction

No keyboard interaction: the component is not focusable.

### Rules

| Rule | Strength | Verified by |
| - | - | - |
| Add a short task-oriented visible label when the spinner is far from the triggering action or the wait may last several seconds | SHOULD | manual: review the visible label beside the waiting task |
| Stop the animation (`animation={false}`) only when another clear status treatment shows that work is ongoing | SHOULD | manual: pause animation, or enable reduced motion, and inspect the remaining status cue |
| Do not show several independent spinners at once | SHOULD NOT | manual: inspect the screen for competing independent spinners |

## API reference

### Properties

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `animation` | `animation` | If `false`, the animation on the icon element will be stopped | `boolean` | `true` |
| `size` | `size` | Defines the size of the icon element displayed | `"small"` \| `"medium"` \| `"large"` | `"medium"` |
| `textPosition` | `text-position` | Defines the position of the label text | `"none"` \| `"left"` \| `"right"` \| `"above"` \| `"below"` | `"none"` |

### Invalid combinations

| Combination | Strength | Result |
| - | - | - |
| `text-position="none"` with text in the default slot | SHOULD NOT | The text is hidden even though the slot has content |

### Slots

| Slot | Description |
| - | - |
| *(default)* | The label or loading message content |
| `icon` | A custom icon that replaces the default spinner loader |

### Shadow parts

| Part | Description |
| - | - |
| `base` | The wrapper container used under the hood |
| `icon` | The `<svg>` icon element used to spin/animate |
| `custom-icon` | The `<span>` element that wraps slotted custom icon content |
| `text` | The `<span>` element that renders the label text |

### CSS custom properties

**CSS variables**

| Variable | Description | Default |
| - | - | - |
| `--bq-spinner--color` | Spinner color | `var(--bq-icon--brand)` |
| `--bq-spinner--size-large` | Spinner large size | `56px` |
| `--bq-spinner--size-medium` | Spinner medium size | `48px` |
| `--bq-spinner--size-small` | Spinner small size | `32px` |
| `--bq-spinner--large-text-fontSize` | Large spinner label font size | `var(--bq-font-size--m)` |
| `--bq-spinner--medium-text-fontSize` | Medium spinner label font size | `var(--bq-font-size--s)` |
| `--bq-spinner--small-text-fontSize` | Small spinner label font size | `var(--bq-font-size--xs)` |
| `--bq-spinner--text-lineHeight` | Spinner label line height | `var(--bq-font-line-height--large)` |
| `--bq-spinner--text-color` | Spinner label text color | `var(--bq-text--primary)` |

> [!TIP]
>
> Learn more about [styling with shadow parts](https://www.beeq.design/guides/styles.md#component-shadow-dom-parts) and [CSS custom properties](https://www.beeq.design/guides/styles.md#global-css-custom-properties).

## Resources

> [card] [Interactive playground](https://storybook.beeq.design/?path=/story/components-spinner--large)
>
> Explore spinner sizes, label positions, and custom icon usage in Storybook.

> [card] [Source code](https://github.com/Endava/BEEQ/tree/main/packages/beeq/src/components/spinner)
>
> Browse the component implementation, styles, and tests on GitHub.


## Related topics

- [Changelog](https://www.beeq.design/releases/changelog.md)
- [Progress](https://www.beeq.design/components/progress.md)
- [Empty State](https://www.beeq.design/components/empty-state.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.