# Skeleton

Sunken clay placeholders with a slow sheen. Size them like the real content so nothing jumps.

Docs: https://cozy-ui.solo.engineer/docs/components/skeleton/

Install: `npx shadcn@latest add @cozy/skeleton`

### Usage

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

<Skeleton className="h-5 w-40" />
```

### Example

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

export default function SkeletonDemo() {
  return (
    <div className="flex w-full max-w-sm items-center gap-4">
      <Skeleton className="size-14 shrink-0 rounded-full" />
      <div className="grid flex-1 gap-2">
        <Skeleton className="h-5 w-3/4" />
        <Skeleton className="h-5 w-1/2" />
      </div>
    </div>
  );
}
```

### Source (components/ui/skeleton.tsx)

```tsx
import * as React from "react";
import { cn } from "@/lib/utils";

function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
  return <div data-slot="skeleton" aria-hidden className={cn("cz-skeleton", className)} {...props} />;
}

export { Skeleton };
```

npm: `import { Skeleton } from "@0xtrou/cozy-ui"` (after `npm install @0xtrou/cozy-ui` and `import "@0xtrou/cozy-ui/styles.css"`).
