Components
Skeleton
Use to show a placeholder while content is loading.
Installation#
Install the dependencies
npm install cnCopy the source into your project
components/ui/skeleton.tsximport { cn } from "cn"function Skeleton({ className, ...props }: React.ComponentProps<"div">) { return ( <div data-slot="skeleton" className={cn("animate-pulse rounded-md bg-muted", className)} {...props} /> )}export { Skeleton }Make sure the foundation is in place
Components read their colors, radius and surfaces from the tokens in
app/globals.css. See Theming.
Usage#
import { Skeleton } from "@/components/ui/skeleton"