<cs-skeleton>
StableFeedbackSince 0.1

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.

EffectBehaviorBest for
none defaultStatic, non-animated placeholderDense layouts where motion would be noisy
sheenA light sweeps across the indicatorSignaling that content is actively loading
pulseThe indicator fades in and outA calmer alternative to sheen
None Sheen Pulse

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 this component, use one of the following snippets.

npm Self-Hosted React
import '@cruglobal/cornerstone-components/components/skeleton/skeleton.js';
import './cornerstone/components/skeleton/skeleton.js';
import CsSkeleton from '@cruglobal/cornerstone-components/react/skeleton/index.js';

Attributes & Properties

Learn more about attributes and properties.

PropertyAttributeDescriptionTypeDefaultReflects
effecteffectDetermines which effect the skeleton will use.'pulse' | 'sheen' | 'none''none'Yes

CSS Custom Properties

Learn more about CSS custom properties.

NameDescriptionDefault
--colorThe color of the skeleton.
--sheen-colorThe sheen color when the skeleton is in its loading state.

CSS Parts

Learn more about CSS parts.

NameDescriptionCSS selector
indicatorThe skeleton's indicator which is responsible for its color and animation.::part(indicator)