Skip to content

Commit 9b9207d

Browse files
committed
feat: add Skeleton and SkeletonCard components for loading placeholders
1 parent 4e2f5ce commit 9b9207d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

components/ui/skeleton-card.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Skeleton } from "@/components/ui/skeleton"
2+
3+
export function SkeletonCard() {
4+
return (
5+
<div className="flex flex-col space-y-3">
6+
<Skeleton className="h-[125px] w-full rounded-xl" />
7+
<div className="space-y-2">
8+
<Skeleton className="h-4 w-full max-w-[250px]" />
9+
<Skeleton className="h-4 w-1/2 max-w-[200px]" />
10+
</div>
11+
</div>
12+
)
13+
}

components/ui/skeleton.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { cn } from "@/lib/utils"
2+
3+
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4+
return (
5+
<div
6+
data-slot="skeleton"
7+
className={cn("bg-accent animate-pulse rounded-md", className)}
8+
{...props}
9+
/>
10+
)
11+
}
12+
13+
export { Skeleton }

0 commit comments

Comments
 (0)