Skip to content
Alea0.1

Feedback

Spinner and Skeleton

Waiting states: a spinner for short waits, skeletons for content that is on its way.

Ant Design: Spin, Skeleton

import { Spinner, Skeleton } from '@alea/ui';

Examples

Spinner

For short waits.

Skeleton

The shape of what is coming. Mark the region aria-busy.

Props

Spinner props

An indeterminate loading ring in the accent gradient.

PropTypeDefaultDescription
aria-labelstring-What is loading, for screen readers. Default "Loading".
classNamestring-Extra class names.
size"sm" | "md" | "lg"'md'sm 16, md 24 (default), lg 40 px.

Skeleton props

A placeholder with a soft shimmer while content loads. Hidden from screen readers; mark the region aria-busy.

PropTypeDefaultDescription
heightstring | number-Height, as px or any CSS length.
linesnumber1Number of text lines (the last one shorter).
shape"circle" | "rect" | "text"'text'text: lines of text; rect: a block; circle: an avatar.
widthstring | number-Width, as px or any CSS length.

Accessibility

  • Skeletons are hidden from screen readers; set aria-busy on the region that is loading.

Do and don't

Do

  • Show it only after about 300 ms, so quick loads don't flash.
  • Give it an aria-label when the reason isn't obvious.

Don't

  • Don't use several spinners on one screen: a Skeleton reads better for content.
  • Don't block the whole page with a spinner for a small part.
Tested with axe, keyboard and screen reader roles