A flexible and customizable Skeleton
loading component for React. Use it to display a placeholder while content is loading — with support for rectangular, circular, and text-shaped skeletons.
- ✅ Customizable width, height, colors, and shapes
- 🔁 Optional pulse animation
- 🎯 Supports rectangular, circular, and text variants
- 🧩 Accepts children (renders them when
loading
isfalse
) - ♿️ Accessible: includes
aria-busy
andaria-label
If you're packaging this as an npm module, update this section accordingly. For now, you can use it locally:
npm install react-skeleton-preview
import { Skeleton } from 'react-skeleton-preview'
<Skeleton width={60} height={60} variant="circular" pulse=true loading={loading} />
<Skeleton width="80%" height={20} margin="1rem 0" variant="text" loading={loading}>
<h2>Text</h2>
</Skeleton>
Pulse animation is injected via JavaScript — no external CSS needed. Works client-side (check for typeof document !== 'undefined')
MIT © Patrick Nassar
Have fun :)