# Skeleton

Use to show a placeholder while content is loading.

## Installation

```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/skeleton.json
```

[Registry JSON](https://reactdocs.canceydejean.dev/r/skeleton.json)

## Preview

```tsx
import { Skeleton } from "@/components/ui/skeleton/skeleton";

export function Preview() {
  return (
    <div className="flex items-center gap-4">
      <Skeleton className="size-12 rounded-full" />
      <div className="grid gap-2">
        <Skeleton className="h-4 w-[200px]" />
        <Skeleton className="h-4 w-[160px]" />
      </div>
    </div>
  );
}
```


## Source

### skeleton.tsx

```tsx
import { cn } from "cn";

function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="skeleton"
      className={cn("bg-muted animate-pulse rounded-md", className)}
      {...props}
    />
  );
}

export { Skeleton };
```



## Usage

Compose rectangles and circles with size utilities to match the target layout.

```tsx
import { Skeleton } from "@/components/skeleton/skeleton";

export function Example() {
  return (
    <div className="flex items-center gap-4">
      <Skeleton className="size-12 rounded-full" />
      <div className="grid gap-2">
        <Skeleton className="h-4 w-[200px]" />
        <Skeleton className="h-4 w-[160px]" />
      </div>
    </div>
  );
}
```

Uses `animate-pulse` and the muted surface token. No external dependencies.

