Skip to content
iv-ui v0.3.0

LoadingSpinner

since 0.1.0

An indeterminate indicator for short waits.

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

Sizes

Small, default, and large diameters.

Source· svelte Show Hide
<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>
  • 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.

Color

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

Source· svelte Show Hide
<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.

Syncing the edge configuration…

Source· svelte Show Hide
<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>
import { LoadingSpinner } from '@elluzion/iv-ui';

Props

2 props · 0 events · 0 snippets
PropTypeDefaultDescription
size number24Diameter in pixels.
color string'var(--iv_accent)'Stroke color; defaults to the current text color.
  • 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.
Class hooks
.iv-spinner
iv-ui
↑ ↓ navigate ↵ open esc close minisearch · 482 records