Feedback

Skeleton.

A pulsing placeholder block to hold space while content loads.

Installation#

With the CLI

$npx lanterncn add skeleton

This also installs the Lantern theme and any Lantern UI components it depends on. The shadcn CLI works directly too: npx shadcn@latest add httptim/lantern-ui/skeleton. See Installation if your project is not set up yet.

Manually

  1. Copy the source into your project

    components/ui/skeleton.tsx
    import * as React from "react";
    
    import { cn } from "@/lib/utils";
    
    function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
      return <div data-slot="skeleton" className={cn("animate-pulse rounded-md bg-secondary", className)} {...props} />;
    }
    
    export { Skeleton };
  2. Update the import paths to match your project

    The source imports cn from @/lib/utils.

Usage#

import { Skeleton } from "@/components/ui/skeleton";
<Skeleton className="h-4 w-40" />