Loaders
Loaders are indicators which convey a busy state to the user. They are used to show the user that something is loading and can even act as a placeholder for content that hasn’t loaded yet.
- Spinner - A spinner is a loading indicator that informs the user that the process is in progress.
- Skeleton - A skeleton is a placeholder for content that hasn’t loaded yet. It is used to show the user that something is loading.
Spinners
Spinners are used to indicate that a process is in progress.
Design Hints
Accessibility Note: We use the role="status"
attribute to inform the user that the content is loading which implicitly sets aria-live="polite"
and aria-atomic="true"
and has an aria-label
attribute to convey additional textual information. For spinners which are used to block the user from further interaction until the process is complete, you can use aria-live="assertive"
instead of role="status"
. The last example in the preview section uses a combination of aria-live="assertive"
and aria-busy="true"
to inform the user that the content is loading, useful when critical information is being loaded or if the full page is waiting for loading content. For more information about role="status"
, refer to this link from the MDN docs about status role .
Skeleton
Skeleton is perfect for giving user an idea of what type of content they can expect to see. It’s best used for loading data or content which may take time to load.
Design Hints
Accessbility Note: We use aria-live="polite"
and aria-busy="true"
to inform assistive technology that the content is being loaded and when the content is loaded you have to set aria-busy="false"
to alert the assistive technology that the content is ready which can be then communicated to the user. If further updates aren’t expected to the content, you can set the aria-live="off"
attribute. For critical information, you can set aria-live="assertive"
instead of aria-live="polite"
so that the user is immediately notified of the changes. To know more about aria-live, refer to this link from the MDN docs about aria-live .
Accessibility Testing Status
Component | NVDA | Windows Narrator | WAVE | Axe | IBM Equal Access |
---|---|---|---|---|---|
Skeleton | Yes | Yes | Yes | Yes | Yes |
Spinner | Yes | Yes | Yes | Yes | Yes |
The accessibility requirements for the loader depend on the type of content being loaded. If the content is critical, use aria-live=“assertive” instead of aria-live=“polite” to immediately notify the user of changes. From a user experience perspective, it’s beneficial to add visible text to the loader, providing additional information to the user. For instance, if loading a list of items, the loader could display text such as “Loading items…” or “Loading more items…“.