npx shadcn@4.23.1 add @goop/meadow-spinnerSpinner
FreeA sign that work is under way and its end is unknown, for React and Tailwind CSS. Free, MIT.
What an agent sees
import { Button } from '@/components/ui/goop/button';
import { Spinner } from '@/components/ui/goop/spinner';
function SaveNotesButton({ saving, onSave }: { saving: boolean; onSave: () => void }) {
return (
<Button disabled={saving} aria-busy={saving} onClick={onSave}>
{saving ? <Spinner aria-hidden /> : null}
{saving ? 'Saving' : 'Save notes'}
</Button>
);
}
function SyncingNotes() {
return (
<div className="flex items-center gap-2 text-base text-muted-foreground">
<Spinner size="sm" label="Syncing the field notes" />
Field notes
</div>
);
}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.
- Also called: loader or loading indicator.
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.
npx shadcn@4.23.1 add @goop/meadow-spinnerAdd the Goop Spinner to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { Button } from '@/components/ui/goop/button';
import { Spinner } from '@/components/ui/goop/spinner';
function SaveNotesButton({ saving, onSave }: { saving: boolean; onSave: () => void }) {
return (
<Button disabled={saving} aria-busy={saving} onClick={onSave}>
{saving ? <Spinner aria-hidden /> : null}
{saving ? 'Saving' : 'Save notes'}
</Button>
);
}
function SyncingNotes() {
return (
<div className="flex items-center gap-2 text-base text-muted-foreground">
<Spinner size="sm" label="Syncing the field notes" />
Field notes
</div>
);
}- Fits: settings, flow: field.
- height, width, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| size | sm | md = md | |
| label? | string = 'Loading' | What a reader hears while the work runs (default "Loading"); a caller's aria-label wins over it. |
- data-slot values (to select a part by): spinner, spinner-icon
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.