Skeleton

<wa-skeleton> Stable Since 2.0

Skeletons show placeholder shapes where content will appear once it finishes loading, reducing perceived wait time and preventing layout shift.

These are simple containers for scaffolding layouts that mimic what users will see when content has finished loading. This prevents large areas of empty space during asynchronous operations.

Skeletons try not to be opinionated, as there are endless possibilities for designing layouts. Therefore, you'll likely use more than one skeleton to create the effect you want. If you find yourself using them frequently, consider creating a template that renders them with the desired arrangement and styles.

Examples

Link to This Section

Effects

Link to This Section

There are two built-in effects, sheen and pulse. Effects are intentionally subtle, as they can be distracting when used extensively. The default is none, which displays a static, non-animated skeleton.

None Sheen Pulse

Paragraphs

Link to This Section

Use multiple skeletons and some clever styles to simulate paragraphs.

Avatars

Link to This Section

Set a matching width and height to make a circle, square, or rounded avatar skeleton.

Custom Shapes

Link to This Section

Set a border-radius on the indicator part to make circles, squares, and rectangles. For more complex shapes, you can apply clip-path to the indicator part. Try Clippy if you need help generating custom shapes.

Custom Colors

Link to This Section

Set the --color and --sheen-color custom properties to adjust the skeleton's color.

Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

CDN npm Self-Hosted React

Import this component directly from the CDN:

import 'https://ka-f.webawesome.com/[email protected]/components/skeleton/skeleton.js';

After installing Web Awesome via npm, import this component:

import '@awesome.me/webawesome/dist/components/skeleton/skeleton.js';

If you're self-hosting Web Awesome, import this component from your server:

import './webawesome/dist/components/skeleton/skeleton.js';

To import this component for React 18 or below, use the following code:

import WaSkeleton from '@awesome.me/webawesome/dist/react/skeleton/index.js';

Attributes & Properties

Link to This Section

Learn more about attributes and properties.

CSS custom properties

Link to This Section

Learn more about CSS custom properties.

CSS parts

Link to This Section

Learn more about CSS parts.

Need a hand? Report a bug Ask for help
    No results