Spinner

A small rotating ring that shows something is loading.

Feedback Added in v0.53.0 Updated

Default


{ui spinner /}

The spinner is a span with role="status", and label is its accessible name, so a screen reader announces it when it appears. It draws with CSS alone and keeps turning with no script. Under prefers-reduced-motion it turns slowly instead of stopping, so it still reads as busy.

Sizes


<div class="flex items-center gap-4">
	{ui spinner, class: 'text-xs' /}
	{ui spinner /}
	{ui spinner, class: 'text-3xl' /}
</div>

The ring is one and a half times the text size, so a text-* class on it resizes it, with any responsive prefix.

To show it while HTMX loads, put it in an element with the htmx-indicator class and point hx-indicator at it. The server still returns the final HTML; the spinner is only the wait.

Beside a disabled button


<div class="flex items-center gap-3">
	{ui button,
		title: 'Saving',
		class: 'button-outline',
		disabled: true,
	/}
	{ui spinner, class: 'text-xs', label: 'Saving' /}
</div>