Introducing PrimeReact v11-alpha 🎉Discover Now

Skeleton

Skeleton is a placeholder to display instead of the actual content.

preview

Installation#

npx shadcn@latest add @primereact/ui/skeleton

Usage#

import { Skeleton } from '@/components/ui/skeleton';
<Skeleton width="4rem" height="2rem" />

Examples#

Basic#

Placeholder shapes that mimic content layout during loading.

basic-demo

Card#

Sample Card implementation using different Skeleton components and Tailwind CSS utilities.

card-demo

Shapes#

Various shapes and sizes can be created using styling properties like shape, width, height, size, borderRadius and className.

Circle
Square
Rectangle
Rounded
shapes-demo

Color#

Customize the background color of the skeleton.

color-demo

Grid#

Sample Grid implementation using different Skeleton components and Tailwind CSS utilities.

grid-demo

API#

Sub-Components#

See Primitive API for sub-component documentation.

Hooks#

See Headless API for hook documentation.

Accessibility#

See Skeleton Primitive for WAI-ARIA compliance details and keyboard support.