Skip to content

    Browse components

    Skeleton Swap

    A shimmering placeholder that dissolves into the real content when loading ends: the skeleton blurs out, the content sharpens in and the box eases to its new height.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/skeleton-swap

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/skeleton-swap.json

    Usage

    import { SkeletonSwap } from "@/components/ui/skeleton-swap";
    
    <SkeletonSwap loading={isLoading}>
      <ProfileRow user={user} />
    </SkeletonSwap>

    Props

    PropTypeDefaultDescription
    linesnumber3Text lines in the default placeholder.
    avatarbooleantrueShow a round avatar in the default placeholder.
    shimmerbooleantrueSweep a highlight across the placeholder.
    durationnumber0.45Cross-fade length in seconds.
    loadingReactNode—Show the skeleton while true.
    skeletonReactNode—Custom placeholder node.
    classNamestring—Extra classes for the root element.