The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { cva, type VariantProps } from "class-variance-authority"; |
| 2 | |
| 3 | import { cn } from "~/lib/utils"; |
| 4 | |
| 5 | const 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 | |
| 16 | function 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 | |
| 26 | export { Skeleton }; |