Open History to see the last commit
1import { cva, type VariantProps } from "class-variance-authority";
2
3import { cn } from "~/lib/utils";
4
5const skeletonVariants = cva("bg-muted-foreground/15 motion-safe:animate-skeleton", {
6 variants: {
7 shape: {
8 block: "rounded-sm",
9 card: "rounded-lg",
10 pill: "rounded-full",
11 },
12 },
13 defaultVariants: { shape: "block" },
14});
15
16function Skeleton({
17 className,
18 shape,
19 ...props
20}: React.ComponentProps<"div"> & VariantProps<typeof skeletonVariants>) {
21 return (
22 <div className={cn(skeletonVariants({ shape }), className)} data-slot="skeleton" {...props} />
23 );
24}
25
26export { Skeleton };