Skip to content

role status

Spinner draft v0.1.0

Says that something is loading when its length is unknown, as a turning ring with a label.

A spinner is the indeterminate loading indicator: a ring turns while a request, a page or a part of it loads, and a label names what loads, shown or kept for assistive technology. Use it for short waits in a small area (a button, a panel); for a long or measurable wait, a Progress bar; for content whose layout is known, Skeletons. Other systems call it an activity indicator, a loading indicator or a progress circle.

Guidelines

From apps/docs/content/components/spinner.md

Overview

A spinner is the indeterminate loading indicator: a ring turns while something loads, and a label names what loads, shown next to the ring or kept for assistive technology only. Use it for short waits in a small area; for a long or measurable wait, a Progress bar; for content whose layout is known, Skeletons. Other systems call it an activity indicator, a loading indicator or a progress circle; the system calls it a spinner because that is what most people and libraries say.

This page applies to every platform. Where a platform differs, the difference sits under a sub-heading named after it (Web, iOS, Android, Desktop); everything else holds everywhere.

When to use

  • A request of unknown length: saving, signing in, searching.
  • An area that waits for content whose shape is unknown.

When not to use

  • The length is known or measurable. Use a Progress bar.
  • The content’s layout is known. Use Skeletons.
  • Decoration. A spinner that turns while nothing happens misleads.

Sizes

Size Use for
Small Inline, in a button or a table cell: 16 px.
Medium Panels, the default: 24 px.
Large Centered in an empty panel or page: 32 px.

Label

The label names what loads (Loading projects, Saving). It is always there: shown next to the ring when there is room, visually hidden otherwise, and announced in both cases.

Accessibility

The Specification tab lists the full accessibility contract. Each statement there links the source it comes from. This section explains the decisions behind it.

Web

  • The implementation renders a <div role="status"> holding the ring (aria-hidden="true") and the label, visually hidden unless shown. Insert it when the wait starts and remove or replace it when the content arrives (MDN: status role, ARIA10, WAI-ARIA: aria-hidden).
  • The rotation is replaced by an opacity pulse under prefers-reduced-motion.

iOS

  • An indeterminate progress indicator, also called an activity indicator, uses an animated image to indicate progress; people prefer a determinate indicator when possible; keep it moving while the operation runs and remove it when it completes. Reduce automatic animations when Reduce Motion is on (Apple HIG: Progress indicators, Apple HIG: Accessibility, cognitive).

Android

  • Progress bar (a measurable wait)
  • Skeleton (content whose layout is known)