Skeleton
The Skeleton component displays a placeholder shape while content is loading. It helps communicate the structure of content before the actual content is available.
Examples
Variants
Use the variant prop to control the shape of the Skeleton.
Custom Styling
Use the class prop to add custom CSS classes to the Skeleton.
The class prop can be used to customize the Skeleton’s appearance or
adjust its dimensions based on the content it represents.
Accessibility
- Use Skeleton only as a visual loading indicator and do not rely on it to communicate essential information.
- Ensure that the loading state is communicated appropriately to assistive technologies when necessary.
- Replace the Skeleton with the actual content when loading is complete.
- Avoid using excessive Skeleton elements that make the loading state difficult to understand.
API
Skeleton
The Skeleton component supports custom styling and different placeholder shapes for representing loading content.
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| class | string |
No | — | Adds custom CSS classes to the Skeleton. |
| variant | "circle" | "rectangle" |
No | "rectangle" |
Controls the shape of the Skeleton. circle displays a circular placeholder, while rectangle displays a rectangular placeholder. |