Skip to main content
ninna-ui

Skeleton

Skeleton component is used to render a placeholder while the content is loading. It provides visual feedback that content is being loaded.

import { Skeleton } from "@ninna-ui/feedback"
pnpm add @ninna-ui/feedback

Requires @ninna-ui/core (auto-installed) + CSS setup.

View source

Usage

Import and use the Skeleton components to display loading placeholders.

import { Skeleton, SkeletonCircle, SkeletonText } from "@ninna-ui/feedback";
export default function Example() {
return (
<div className="space-y-4">
<div className="flex items-center gap-4">
<SkeletonCircle size="40px" />
<SkeletonText noOfLines={2} />
</div>
<Skeleton height="200px" />
</div>
);
}

Basic

Basic skeleton placeholders with different widths.

Loading...
Loading...
Loading...

Variants

Different animation variants: pulse, shine, or none.

Pulse (default)

Loading...

Shine

Loading...

None

Loading...

Circle

Circular skeleton for avatar placeholders.

Loading...
Loading...
Loading...
Loading...

Text

Text skeleton for paragraph placeholders.

Loading...
Loading...
Loading...

With Children

Toggle between skeleton and actual content using the loading prop.

Loading...
Loading...

Use Cases

Common skeleton patterns for cards, profiles, feeds, and tables.

Card Skeleton

Loading...
Loading...
Loading...
Loading...

Profile Skeleton

Loading...
Loading...
Loading...

Feed Skeleton

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Table Skeleton

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

API Reference

Complete list of props for the Skeleton components.

Skeleton Props

Props

PropTypeDefaultDescription
variant'pulse' | 'shine' | 'none''pulse'Animation variant for the skeleton
widthstring | number-Width of the skeleton (e.g., '200px', 200, '100%')
heightstring | number-Height of the skeleton (e.g., '20px', 20)
radius'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full''md'Border radius of the skeleton
loadingbooleantrueWhether the skeleton is in loading state
childrenReact.ReactNode-Content to show when loading is false
classNamestring-Additional CSS classes

SkeletonCircle Props

Props

PropTypeDefaultDescription
sizestring | number'40px'Size of the circle (width and height)
variant'pulse' | 'shine' | 'none''pulse'Animation variant
loadingbooleantrueWhether the skeleton is in loading state
childrenReact.ReactNode-Content to show when loading is false
classNamestring-Additional CSS classes

SkeletonText Props

Props

PropTypeDefaultDescription
noOfLinesnumber3Number of text lines to render
gapstring | number'8px'Gap between lines
variant'pulse' | 'shine' | 'none''pulse'Animation variant
loadingbooleantrueWhether the skeleton is in loading state
childrenReact.ReactNode-Content to show when loading is false
classNamestring-Additional CSS classes

Accessibility

  • Uses role="status" to indicate loading state
  • Sets aria-busy="true" to indicate content is loading
  • Includes visually hidden "Loading..." text via sr-only class for screen readers
  • Smoothly transitions to content when loading completes