skeleton

PreviousNext
Docs
cossui

Preview

Loading preview…
registry/default/ui/skeleton.tsx
import { cn } from "@/registry/default/lib/utils";

function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      className={cn(
        "animate-skeleton rounded-sm [--skeleton-highlight:--alpha(var(--color-white)/64%)] [background:linear-gradient(120deg,transparent_40%,var(--skeleton-highlight),transparent_60%)_var(--color-muted)_0_0/200%_100%_fixed] dark:[--skeleton-highlight:--alpha(var(--color-white)/4%)]",
        className,
      )}
      data-slot="skeleton"
      {...props}
    />
  );
}

export { Skeleton };

Installation

npx shadcn@latest add @coss/skeleton

Usage

import { Skeleton } from "@/components/ui/skeleton"
<Skeleton />