shadcn.io is not affiliated with official shadcn/ui
Spinner examples · Inline
Spinner After Text for React
A small spinner after a line of text saying the request is processing.
Put the words first when the message matters more than the motion. This line reads Processing your request, followed by a 12px Spinner, in a flex row.
Preview
Installation
FAQ
Why does the spinner come after the words?
The paragraph's children are the text "Processing your request", then the Spinner. In a flex row that paints in DOM order, so the words lead and the wheel follows.
What size is the spinner after the text?
size-3, which is 12px. The default is size-4. The paragraph is text-sm, so the smaller icon sits with that line.
How are the words and the spinner aligned?
The p is flex items-center gap-2 text-sm. items-center lines the icon up with the text, and gap-2 is the space between them.
What color is the spinner here?
The paragraph sets no text color, and the Spinner sets none either. The icon uses currentColor, so it matches the paragraph. Add text-muted-foreground on the p to mute both.
Related
- Inline with Text SpinnerA spinner beside a Loading data
- Spinner Before TextA small spinner before a muted line of
- Spinner in List ItemA list item with a muted spinner, a title
- Loading Button SpinnerA disabled button with a spinner before
- Default SpinnerA spinner at its default size and color
- Spinner in Input GroupA disabled input and textarea with a