Create

Feedback

Skeleton

Copy page View as Markdown Open in ChatGPT Open in Claude

Use to show a placeholder while content is loading.

Usage#

app.component.ts
import { WdsSkeletonComponent } from '@wds/angular/skeleton';

Size each placeholder with classes (h-4 w-48, size-12) to match the content it stands for. Without a height a skeleton is one line of text tall.

Examples#

Default#

shape="circle" makes a round placeholder (e.g. for an avatar); set one dimension, the other follows.

Card#

The loading region has aria-busy="true" and a visually hidden "Loading…", because skeletons are hidden from screen readers. Classes on the skeleton (rounded-xl, aspect-video) change its shape.

Loading…

Text#

Without a height each skeleton is one line of the surrounding text, so a paragraph is a few lines and a shorter last one.

Form#

Labels and fields of a form while its data loads.

Table#

Rows of a table with the same columns as the loaded data.

Stats#

A row of metric cards in a dashboard.

Animation#

animation is pulse (default), wave (a light passes over the placeholder) or none. With "reduce motion" turned on in the system, skeletons do not animate.

pulse (default)
wave
none

API References#

wds-skeleton#

A placeholder that shows the shape of content while it loads. Set its size with CSS (e.g. h-4 w-48 classes); without a height it is as tall as a line of text. A skeleton is hidden from screen readers. Mark the loading region with aria-busy="true" and give it a text alternative, e.g. a visually hidden "Loading…".

Attributes

AttributeTypeDefaultDescription
shapeWdsSkeletonShape'default'circle: round, with equal width and height (set one of them), e.g. for an avatar.
animationWdsSkeletonAnimation'pulse'pulse fades in and out, wave passes a light over the placeholder, none stays still.

CSS parts (::part)

PartDescription
baseThe placeholder.

CSS custom properties

PropertyDescription
--wds-skeleton-bgBackground (default --wds-accent).
--wds-skeleton-highlightColor of the light passing over the wave animation.
--wds-skeleton-radiusCorner radius (default --wds-radius-md).

Accessibility#

Screen reader#

Skeletons are hidden from screen readers (aria-hidden="true"): they only show the shape of the content.

Mark the region that is loading with aria-busy="true" and give it a text alternative, e.g. a visually hidden "Loading…". Remove aria-busy when the content is there.

The animation stops when the user prefers reduced motion.

Keyboard support#

Skeletons are not focusable and have no keyboard interaction.

Footer