Spinner
June 16, 2026 ยท View on GitHub
A spinner is an animated indicator that lets users know content or action is being loaded.
Overview
Use a spinner to indicate a short, indeterminate loading state. It can appear on its own or paired with a loading message. For longer processes with measurable progress, use the Progress Bar component.
Usage
Import DAFF_SPINNER_COMPONENTS into your component:
import { DAFF_SPINNER_COMPONENTS } from '@daffodil/design/spinner';
@Component({
selector: 'custom-component',
templateUrl: './custom-component.component.html',
imports: [
DAFF_SPINNER_COMPONENTS,
],
})
export class CustomComponent {}
Anatomy
A spinner is composed of an animated indicator with an optional label:
<daff-spinner>
<daff-spinner-label>Loading products...</daff-spinner-label>
</daff-spinner>
<daff-spinner>: The animated loading indicator.<daff-spinner-label>: An optional label that describes the loading state and provides context for users.
Features
Colors
Use the color property to change the color of a spinner.
Note:
dark,light, andthemeshould be used on appropriate backgrounds for sufficient contrast.
Sizes
Use the size property to change the size of a spinner. The default size is md.
Accessibility
Built-in behavior
role="status"on the spinner announces content changes to assistive technologies.- When
<daff-spinner-label>is used, its visible text serves as the accessible name. When no label is provided, the spinner defaults toaria-label="loading".
Developer responsibilities
- When no label is shown, customize the accessible name with the
aria-labelinput to describe the loading state:
<daff-spinner aria-label="Saving changes"></daff-spinner>