shadcn.io is not affiliated with official shadcn/ui
Spinner examples · Inline
Spinner in List Item for React
A list item with a muted spinner, a title and a description while a profile loads.
A row can load on its own while the rest of the list is ready. This Item shows a muted Spinner as its media, with Loading user profile and a short description.
Preview
Installation
FAQ
Which item parts does this row use?
Item, then ItemMedia, then ItemContent with ItemTitle and ItemDescription. ItemMedia leaves variant at its default. The spinner is the media.
How is the spinner muted?
className is text-muted-foreground on the Spinner. The icon uses currentColor, so that class is the color. The size stays the default size-4.
What do the title and description say?
ItemTitle is "Loading user profile". ItemDescription is "Please wait while we fetch your data". Both are visible text beside the spinner.
What does a screen reader announce?
The title and description are read as text. The spinner has role="status" and an aria-label of Loading. Pass aria-label="Loading user profile" on the Spinner when the status should match the title.
Related
- Inline with Text SpinnerA spinner beside a Loading data
- Spinner Before TextA small spinner before a muted line of
- Spinner After TextA small spinner after a line of text
- Spinner in ItemA download row with a spinner, the size
- Default SpinnerA spinner at its default size and color
- Simple Card with Image and Text SkeletonA card placeholder with a wide image