Skip to content

TkxSkeleton

Shapes
import { TkxSkeleton } from 'tekivex-ui';
{loading
? <TkxSkeleton width={200} height={20} />
: <span>{user.name}</span>
}
<TkxSkeleton width={200} height={20} /> {/* default rect */}
<TkxSkeleton width={200} height={20} rounded /> {/* rounded rect */}
<TkxSkeleton variant="circle" width={40} /> {/* circle (avatar) */}
<TkxSkeleton variant="text" /> {/* text line, full width */}
<TkxSkeleton variant="text" count={3} />
{/* 3 stacked text lines, last one slightly shorter for realism */}
Composed card skeleton
<TkxCard>
<TkxCardBody>
<div style={{ display: 'flex', gap: 12, alignItems: 'center' }}>
<TkxSkeleton variant="circle" width={48} />
<div style={{ flex: 1 }}>
<TkxSkeleton width="60%" height={16} />
<TkxSkeleton width="40%" height={12} style={{ marginTop: 6 }} />
</div>
</div>
<TkxSkeleton variant="text" count={3} style={{ marginTop: 12 }} />
</TkxCardBody>
</TkxCard>

Pure CSS animation, no hooks. Renders in Next.js Server Components.

  • Skeleton is aria-hidden="true" — screen readers don’t announce noise
  • Pair with a parent element carrying aria-busy="true" or aria-live region so assistive tech knows content is loading
  • Animation respects prefers-reduced-motion — shimmer becomes static when reduced motion is enabled
PropTypeRequiredDescription
widthnumber | stringNumeric (px) or any CSS length.
heightnumber | stringSame.
variant'rect' | 'text' | 'circle'Defaults to rect.
roundedbooleanApply 6px border-radius (rect only).
countnumberFor variant="text" — render N stacked lines.

src/components/TkxSkeleton.tsx