Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Spinner Before Text for Svelte

A 12px spinner, then the muted words Syncing your changes. Nothing in the demo is actually syncing.

UI library: Ark UI

A muted line leads with a 12px spinner and then reads Syncing your changes. Both share the muted color. No sync is running.

Use it for background work that should stay quiet. Lead with the words if the sentence matters more. A layout that is still arriving can use a Skeleton. In Svelte, Ark UI labels the spinner Loading.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Spinner anatomy: item, spinner, title

Usage

<p class="flex items-center gap-2 text-muted-foreground text-sm"><Spinner class="size-3" />Syncing your changes</p>

FAQ

Why is the spinner before the words?

The Spinner is the first child of the paragraph, and the text "Syncing your changes" is the second. The p is a flex row, so that DOM order is the visual order.

Why are the spinner and the text both muted?

text-muted-foreground is on the p, not on the spinner. The icon uses currentColor, so it picks up the paragraph's text color along with the words.

What size is the spinner next to Syncing your changes?

size-3 (12px) on the Spinner, and text-sm on the paragraph. items-center aligns them, and gap-2 is the space between.

Why is this a paragraph?

The status is one line of text, so the file uses a p with flex on it. The spinner is an SVG inside that paragraph, with role="status".

What does a screen reader announce?

The spinner's aria-label is Loading, and the paragraph text is "Syncing your changes". Pass a matching aria-label, such as "Syncing your changes", when you want one announcement for the line.

How do I stop the spin for reduced motion?

Add motion-reduce:animate-none on the Spinner, next to size-3. The words stay, and the icon stops.

API Reference

Spinner

No extra props in this demo. The rest is on the Spinner page.