Skeleton

A placeholder UI that mimics the layout of content while it’s loading.

Example

Installation

Install following dependencies:

npm install react-aria-components tw-animate-css tailwindcss-react-aria-components class-variance-authority lucide-react clsx tailwind-merge motion

Add cn helper using clsx and twMerge for conditional class merging in Tailwind components.

lib/utils.ts

Copy and paste the following code into your project.

components/ui/core/skeleton.tsx
npx @libravelui@latest add skeleton

Anatomy

import { Skeleton } from "@/components/ui/core/skeleton";
<Skeleton className="h-12 w-12 rounded-full" />
<SkeletonText lines={5} />

Another Example

Lines

You can use SkeletonText to make multiple pulsing lines as a loading placeholder.

Props

Loading types…