Components/Feedback

Spinner

Spinners say that something is in progress without saying how far along it is. They suit a wait whose length is unknown and whose result has no shape to stand in for — a request that has been sent and has not come back yet.

import { Spinner } from '@growth-protocol-ai/alpha';

On this page

size
Spinner.tsxtsx
1import { Spinner } from '@growth-protocol-ai/alpha';
2
3<Spinner size="sm" />

When to use

Reach for a spinner when work is under way and there is nothing honest to say about how far along it is — a request in flight, a form being submitted, a panel fetching for itself. Put the ring where the result will appear, so it answers the question the reader is already asking, and take it away the moment the content lands.

When not to use

Do not use a spinner where the shape of what is coming is already known — a list of rows, a card, a paragraph of copy. That is Skeleton, which draws the outline the content will fill so the page does not jump when it arrives. The two are told apart by that one question rather than by how long the wait is: a shape to stand in for is a skeleton, no shape is a ring.

size5 values

Size is the only decision, and what answers it is whatever the ring sits next to — not how important the wait is. The stroke thickens with the diameter, from 2px to 4px, so the ring keeps the same weight at every size, and the speed never changes: 0.8s a turn everywhere, because a faster spinner does not mean a shorter wait.

xs
sm
md
lg
xl
sizeWhen to use
xs16px. Inline in running text, and inside a control that is already small.
smThe default, 20px. A glyph in a regular button, and the size to reach for when nothing suggests otherwise.
md24px. Large buttons, and action triggers that stand on their own.
lg32px. A card waiting on its own fetch.
xl48px. A whole page or a blocking overlay, where the ring is the only thing on screen.