---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Spinner

A sign that work is under way and its end is unknown, inside a button or a loading view, for React and Tailwind CSS. Free, MIT.

Free. Its export: `Spinner`.

## Try it

Switch the size, rename what a screen reader hears, and set it before a line of words or in a busy button, outline or filled; with reduced motion asked for it stands still.

Nothing is loading.

## When to use

- A sign that work is under way and its end is unknown, inside a button or a loading view.
- Also called: loader or loading indicator.

## When not to use

- For a known end use Progress.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Spinner on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

```sh
npx shadcn@4.23.1 add @goop/trail-spinner
```

```text
Add the Goop Spinner to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { Spinner } from '@/components/ui/goop/spinner';

<div className="flex items-center gap-2 text-sm text-muted-foreground">
  <Spinner size="sm" aria-hidden />
  Syncing the field notes…
</div>
```

- Fits: settings, flow: field.
- height, width, motion: add no class for these.

## API reference

### Options

- `size: sm | md = md`
- `label?: string = 'Loading'` — What a reader hears while the work runs; a caller's `aria-label` wins over it.

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Progress](/themes/trail/components/progress): A bar for work under way, its amount known or not.
- [Separator](/themes/trail/components/separator): A hairline between two groups of content, across or upright, such as between menu sections or toolbar groups.
- [Alert](/themes/trail/components/alert): A message about the state of something that stays inline in the page until it changes.
- [Banner](/themes/trail/components/banner): A full-width band across the top of the app or a page for one message that stays until it is no longer true, such as a trial ending.
