Skeleton

Loading

Content placeholder loading skeleton.

Preview

Usage

example.jsx
import { Skeleton } from "@/components/ui/skeleton";

export default function Example() {
  return <Skeleton />;
}

Source Code

Copy this file into components/ui/skeleton.jsx in your project.

skeleton.jsx
import { forwardRef } from "react";
import { cn } from "@/lib/utils";

const Skeleton = forwardRef(({ className, ...props }, ref) => (
  <div ref={ref} className={cn("animate-pulse rounded-md bg-muted", className)} {...props} />
));
Skeleton.displayName = "Skeleton";

export { Skeleton };

Quick Install

Make sure you have the cn() utility set up. It requires clsx and tailwind-merge.

npm install clsx tailwind-merge