shadcn.io is not affiliated with official shadcn/ui
Spinner examples · Button
Loading Outline Button Spinner for React
A disabled outline button with a spinner before its Processing label.
A loading state for a less prominent action. This outline button is disabled while the work runs, with a Spinner before the Processing label.
Preview
Installation
FAQ
How is this an outline button?
variant is outline on the Button. The spinner and the label Processing are the children. disabled is set, so the button can't be pressed again.
How does the spinner sit in front of Processing?
The Spinner is the first child, with data-icon set to inline-start. The button's icon spacing then puts the wheel before the word.
What color is the spinner on an outline button?
The icon uses currentColor, so it takes the outline button's text color. This file sets no color class on the Spinner.
Can the label name the action?
Yes. This file uses "Processing". Replace that string with "Saving" or "Sending" and keep variant, the disabled state and the Spinner.
Related
- Loading Button SpinnerA disabled button with a spinner before
- Loading Secondary Button SpinnerA disabled secondary button with a
- Loading Icon Button SpinnerA disabled icon-only button that shows
- Button with Left Icon (Standard)An icon on the main action
- Loading Small Button SpinnerA small disabled button with a smaller
- Inline with Text SpinnerA spinner beside a Loading data