Skeleton
Skeletons show placeholder shapes where content will appear once it finishes loading, reducing perceived wait time and preventing layout shift.
A single skeleton stands in for one line or shape. Because layouts vary endlessly, you'll usually combine several to mirror the content that's loading. If you reach for the same arrangement often, wrap it in a template that renders the skeletons with your spacing and styles.
Examples
Effect
Set the effect attribute to choose how the skeleton animates while content loads. Effects are intentionally subtle, since motion across many skeletons at once can distract.
| Effect | Behavior | Best for |
|---|---|---|
none |
Static, non-animated placeholder | Dense layouts where motion would be noisy |
sheen |
A light sweeps across the indicator | Signaling that content is actively loading |
pulse |
The indicator fades in and out | A calmer alternative to sheen |
Paragraphs
Stack several skeletons and vary their widths to stand in for a block of text.
Avatars
Set a matching width and height to stand in for a circle, square, or rounded avatar.
Shapes
Set a border-radius on the indicator part to make circles, squares, and rectangles. For more complex shapes, apply a clip-path to the indicator part. Try Clippy if you need help generating custom shapes.
Colors
Set the --color and --sheen-color custom properties to tune the skeleton to your surface. --sheen-color is the highlight that sweeps across when effect="sheen".
API
Importing
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.
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
Learn more about attributes and properties.
| Name | Description | Reflects |
|---|---|---|
effecteffect |
Determines which effect the skeleton will use.
Type
'pulse' | 'sheen' | 'none'
Default
'none'
|
|
CSS Custom Properties
Learn more about CSS custom properties.
| Name | Description |
|---|---|
--color |
The color of the skeleton.
|
--sheen-color |
The sheen color when the skeleton is in its loading state.
|
CSS Parts
Learn more about CSS parts.
| Name | Description | CSS selector |
|---|---|---|
indicator |
The skeleton's indicator which is responsible for its color and animation. |
::part(indicator)
|