Basics
The size prop is required and controls the spinner dimensions. The value is in pixels and determines the font size from which the width (10em), height (10em), and border width (1.1em) are calculated.
Buttons
Use loading on Button and IconButton to show a spinner during async operations. The button becomes non-interactive while preserving its dimensions.
Styling
Color
Use the color prop to customize the spinner's color. The default is fgMuted. Any valid CDS design token color can be used.
On Colored Backgrounds
When placing a spinner on a colored background, choose a color with sufficient contrast.
Sizing
Use different sizes to match the context - smaller spinners work well inline or within buttons, while larger spinners are appropriate for page or section loading states.
Accessibility
Use accessibilityLabel to provide context for screen readers. The spinner uses role="status" and aria-live="polite" to announce the loading state.