---
title: "LoadingSpinner"
description: "An indeterminate indicator for short waits."
category: "Feedback & Status"
slug: loading-spinner
url: /components/loading-spinner
since: "0.1.0"
status: "stable"
---

# LoadingSpinner

An indeterminate indicator for short waits.

## Import

```svelte
import { LoadingSpinner } from '@elluzion/iv-ui';
```

## Preview

Small, default, and large diameters.

```svelte
<script lang="ts">
	import { LoadingSpinner } from '@elluzion/iv-ui';
</script>

<div class="row">
	<LoadingSpinner size={14} />
	<LoadingSpinner />
	<LoadingSpinner size={36} />
</div>

<style>
	.row {
		display: flex;
		align-items: center;
		gap: var(--iv_spacing-lg);
	}
</style>
```

## Usage

- `size` is the diameter in pixels; `color` defaults to the accent token.
- It announces itself as a status; add text when the wait may be long.
- For determinate work, use `Progress` instead.

## Examples

### Color

Pass any CSS color; the default is the brass accent.

```svelte
<script lang="ts">
	import { LoadingSpinner } from '@elluzion/iv-ui';
</script>

<div class="row">
	<LoadingSpinner size={22} color="var(--iv_success)" />
	<LoadingSpinner size={22} color="var(--iv_error)" />
	<LoadingSpinner size={22} color="var(--iv_foreground-dim)" />
</div>

<style>
	.row {
		display: flex;
		align-items: center;
		gap: var(--iv_spacing-lg);
	}
</style>
```

### Inline

The spinner sits on the text baseline inside a status row.

```svelte
<script lang="ts">
	import { LoadingSpinner } from '@elluzion/iv-ui';
</script>

<p class="status">
	<LoadingSpinner size={14} />
	Syncing the edge configuration…
</p>

<style>
	.status {
		display: flex;
		align-items: center;
		gap: var(--iv_spacing-sm);
		margin: 0;
		font-family: var(--iv_font-mono);
		font-size: var(--iv_text-body);
		color: var(--iv_foreground-dim);
	}
</style>
```

### Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `number` | `24` | Diameter in pixels. |
| `color` | `string` | `'var(--iv_accent)'` | Stroke color; defaults to the current text color. |

### Tokens used

`--iv_spin-duration` · `--iv_spin-easing` · `--iv_spinner-border`

See the [token reference](/foundations/tokens.md) for values.

### CSS hooks

`.iv-spinner`

## Accessibility

- The spinner uses `role="status"` with the label `Loading`.
- It is decorative only in the sense of size; screen readers announce the status.
- Rotation stops when `prefers-reduced-motion` is set.

## Related

- [Progress](/components/progress.md)
- [Skeleton](/components/skeleton.md)
- [Button](/components/button.md)
- [EmptyState](/components/empty-state.md)