shadcn.io is not affiliated with official shadcn/ui
Spinner examples · Applications
Spinner in Empty State for React
A full-area loading state with a spinner, a title, a warning not to refresh and a Cancel button.
A long task needs more than a wheel: say what is happening and how to stop it. This Empty state puts a Spinner in EmptyMedia, a title and a Do not refresh warning in the header, and a Cancel button below.
Preview
Installation
FAQ
Where does the spinner sit in the empty state?
Inside EmptyMedia with variant set to icon, in the EmptyHeader. The Spinner is the default size, with role="status" and an aria-label of Loading.
What do the title and description say?
EmptyTitle is "Processing your request". EmptyDescription is "Please wait while we process your request. Do not refresh the page." Both are visible text under the spinner.
What is the Cancel button?
A Button in EmptyContent, with size sm and variant outline, labeled Cancel. It sits under the header. This file does not attach a click handler.
Which empty parts does this file use?
Empty wraps EmptyHeader and EmptyContent. The header holds EmptyMedia, EmptyTitle, and EmptyDescription. Empty has className w-full.
Related
- Spinner in ItemA download row with a spinner, the size
- Spinner in Input GroupA disabled input and textarea with a
- Default SpinnerA spinner at its default size and color
- Simple Empty StateA minimal empty state with a file
- Loading Button SpinnerA disabled button with a spinner before
- Loading Icon Button SpinnerA disabled icon-only button that shows