Skip to content

Skeleton

The Skeleton component provides a low-fidelity representation of elements that are not yet ready. It’s commonly used to indicate loading states, giving users a sense of progress and reducing perceived wait times by showing the layout of the content that will eventually appear.

The Skeleton component acts as a container that applies an animating pulse effect, while SkeletonItem is used for the individual placeholder blocks within it.

Add the Skeleton and SkeletonItem components to your project using the OrbitUI CLI:

Terminal window
npx orbitkit@latest add skeleton

Import the Skeleton and SkeletonItem components and use them in your Astro components or pages. Wrap your SkeletonItem instances within the Skeleton component to apply the pulsing animation.

You’ll typically apply w- and h- utility classes to SkeletonItem to define the dimensions of your placeholder blocks, mimicking the size of the content they represent.

The Skeleton component acts as a wrapper for the pulsing animation. This component accepts all the standard HTML attributes that a div element would.

The SkeletonItem component represents an individual content block that is being loaded. This component accepts all the standard HTML attributes that a div element would.