Skip to content

Spinner

An indeterminate spinner that inherits the text colour and size around it.

On this page
Used for
  • Pending requests
  • Button loading
  • Model thinking
  • Saving changes

Examples

Installation

npx knowns-ui@latest add spinner
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

label
string
Default"Loading"
Accessible label; an empty string makes it decorative.
className
string
Size it with size-*, colour it with text-*.

What it handles

  1. 01Draws a small SVG ring that turns, sized at 16px and following the text size of its parent.
  2. 02Inherits the text colour from its parent, so it matches a button, a label or a muted line.
  3. 03Takes a `label`, which defaults to "Loading", and exposes it with the status role.
  4. 04Hides itself from assistive tech when `label` is an empty string, for a spinner beside text that already says so.
  5. 05Takes `className` to change its size or colour.
  6. 06Stops turning under reduced motion and stays as a still ring.

States

First render
The ring appears and starts turning
none
Loading
The ring turns in a continuous loop
none
Reduced motion
The ring stays still
0ms

Works with

When to use

When to use

  • Short waits inside a button or next to a label.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Spinner to my app and wire it to my own data.
  • I need short waits inside a button or next to a label. Set that up with the Knowns UI Spinner.
  • Which Spinner props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "spinner" }) and search_docs({ query: "spinner" }).

Need help?

Stuck on Spinner, or found something off? We read every message.