Components

26 components — 3 primitives, 4 atomic, 19 composites

Composites here cover most layouts out of the box. When your design needs a shape none of them offer, the primitives (Skeleton, TextSkeleton, SkeletonGroup) compose freely — see it done in Examples.

Code snippets assume Tailwind CSS for the wrapper markup (flex, gap-4, card, etc.) — the skeleton component calls themselves work with any styling setup.

Primitives

Skeleton

The core building block. Every other component composes from this.

Examples

Rectangle

TSX
import { Skeleton } from "@gyojiro/autoskeleton-react";

<div className="space-y-2">
  <Skeleton width="100%" height={16} />
  <Skeleton width="80%" height={16} />
  <Skeleton width="60%" height={16} />
</div>

Variants

default
rounded
circle 48
circle 64
TSX
import { Skeleton } from "@gyojiro/autoskeleton-react";

<div className="flex flex-wrap gap-4 items-center">
  <Skeleton width={80} height={36} />
  <Skeleton width={80} height={36} variant="rounded" />
  <Skeleton variant="circle" size={48} />
  <Skeleton variant="circle" size={64} />
</div>

Animations

wave

pulse

fade

none

TSX
import { Skeleton } from "@gyojiro/autoskeleton-react";

{(["wave", "pulse", "fade", "none"] as const).map((anim) => (
  <Skeleton key={anim} width="100%" height={36} animation={anim} />
))}

Props

PropTypeDefaultDescription
widthnumber | string"100%"Width of the skeleton.
heightnumber | string16Height of the skeleton.
sizenumber | stringDiameter when variant="circle". Ignored for every other variant — use width/height there.
radiusSkeletonRadiustheme.radius"none" | "sm" | "md" | "lg" | "full" | string
animationSkeletonAnimationtheme.animation"wave" | "pulse" | "fade" | "none"
variantSkeletonVariant"default""default" | "rounded" | "circle"
classNamestringAdditional CSS class names.
styleCSSPropertiesInline style overrides.
aria-labelstringWhen set, the skeleton is announced by screen readers.
data-testidstringHTML test attribute.