Skip to content

role presentation

Skeleton draft v0.1.0

A placeholder shape that stands in for content while it loads.

A skeleton draws the outline of content that is not there yet: a line of text, an avatar, a card. Several skeletons laid out like the content they stand for tell people what is coming and where, with less jump than a spinner followed by the real content. A skeleton is invisible to assistive technology; the region that loads says so itself.

Guidelines

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

Overview

A skeleton draws the outline of content that is not there yet: a line of text, an avatar, a card. Several skeletons laid out like the content they stand for tell people what is coming and where, with less jump than a spinner followed by the real content. A skeleton is invisible to assistive technology; the region that loads says so itself.

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

  • Content whose layout is known before it arrives: a list of cards, a profile, a table.
  • Waits of a second or two, where a spinner would flash.

When not to use

  • A wait of unknown shape (a search): use a Spinner.
  • A measurable wait: use a Progress bar.
  • Decoration. A skeleton that never turns into content misleads.

Shapes

Shape Use for
Text A line of text: full width by default, 16 px high. Stack several, the last one shorter, for a paragraph.
Circle An avatar or an icon: a 40 px disc.
Rectangle A block, an image, a card: full width, 96 px high, 8 px corners.

Width and height are the content’s: pass them as lengths or percentages.

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 <span aria-hidden="true"> with the shape as a data attribute and the width and height as custom properties in its style; the animation is switched off under prefers-reduced-motion.

iOS

Android

  • Spinner (a wait of unknown shape)
  • Progress bar (a measurable wait)