Skip to content

React Skeleton Loader is a minimalist UI utility designed for React applications. It provides animated placeholders that mimic the layout of your content while it's loading — improving perceived performance and creating a polished loading experience. With built-in support for rectangular and circular shapes and smooth animations

Notifications You must be signed in to change notification settings

victorolayemi/react-skeleton-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Skeleton Loader

A lightweight, customizable React component for rendering skeleton loaders while content is loading.

npm version license downloads

React Skeleton Loader Example


✨ Features

  • Lightweight & customizable
  • Built-in pulse animation
  • Supports circle and rectangular shapes
  • Easily stylable via className and style

📦 Installation

npm install react-skeleton-loaders
yarn add react-skeleton-loaders

🚀 Basic Usage


import React from 'react';
import Skeleton from 'react-skeleton-loaders';

const MyComponent = () => {
  return (
    <div>
      <Skeleton width="100%" height="20px" />
      <Skeleton width="60%" height="20px" style={{ marginTop: 10 }} />
      <Skeleton circle width="40px" height="40px" />
    </div>
  );
};

📚 Full Example


import React from 'react';
import Skeleton from 'react-skeleton-loaders';

const App = () => {
  const posts = [1, 2, 3, 4, 5, 6];

  return (
    <div style={{
      display: 'grid',
      gridTemplateColumns: 'repeat(auto-fill, minmax(500px, 1fr))',
      gap: '20px',
      margin: '10px',
    }}>
      {posts.map((post, index) => (
        <div key={index} style={{ padding: '10px', border: '1px solid #ddd', borderRadius: '8px' }}>
          <Skeleton circle width="40px" height="40px" />
          <Skeleton width="60%" height="20px" />
          <Skeleton width="100%" height="15px" />
          <Skeleton width="100%" height="15px" />
        </div>
      ))}
    </div>
  );
};

export default App;

⚙️ Props

Prop Type Default Description
width string | number "100%" Width of the skeleton
height string | number "1rem" Height of the skeleton
circle boolean false Renders as a circle
className string "" Custom class for styling
style React.CSSProperties {} Inline styles

🧪 Development

npm run build

📝 License

MIT License © Victor Olayemi

About

React Skeleton Loader is a minimalist UI utility designed for React applications. It provides animated placeholders that mimic the layout of your content while it's loading — improving perceived performance and creating a polished loading experience. With built-in support for rectangular and circular shapes and smooth animations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published