You can customize the size and color of the spinner with the provided properties. Spinner comes in three sizes: small, medium and large.
<duet-spinner size="small" theme="default"></duet-spinner>
<duet-spinner size="medium" theme="default"></duet-spinner>
<duet-spinner size="large" theme="default"></duet-spinner>
<duet-spinner size="large" color="currentColor"></duet-spinner>
<duet-spinner size="large" color="success"></duet-spinner>
| || ||Adds accessible label for the spinner that is only shown for screen readers.|| || |
| || ||Color of the spinner, as a design token entered in camelCase or kebab-case. Example: "color-primary". This property can also be set to "currentColor" which forces the icon to use the CSS text color of parent element instead. Useful when you want to control the color in stylesheet instead.|| || |
| || ||Size variation of the spinner.|| || |
| || ||Theme of the spinner. When used this will override the color setting and use "primary" or "primary-turva" as the color depending on which theme is chosen.|| || |
This section includes guidelines for designers and developers about the usage of this component in different contexts.
When to use #
- To indicate users that their action is being processed.
- For loading states.
When not to use #
- For showing progress. Favor a progress bar instead.
This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.
- Spinner is a custom element with animated loading indicator inside.
- To communicate loading state for a user, use aria-live attributes and appropriate content.
accessibleLabelproperty can be used to add aria-label for the spinner that is only shown for screen readers.
Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:
Using CLI ToolsTutorials
Creating Custom PatternsTutorials
Server Side RenderingTutorials
Usage With MarkdownTutorials
If you experience any issues while using a component, please head over to the Support page for more guidelines and help.