🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@mohsensami/react-loading-skeleton

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mohsensami/react-loading-skeleton

A simple React loading skeleton component

1.0.7
latest
Source
npm
Version published
Weekly downloads
413
Maintainers
1
Weekly downloads
 
Created
Source

react-loading-skeleton

A lightweight and customizable React component for creating loading skeleton screens. This package provides an easy way to implement loading states in your React applications with smooth animations and various shape options.

Installation

npm install @mohsensami/react-loading-skeleton
# or
yarn add @mohsensami/react-loading-skeleton

Features

  • Multiple shape variants (text, circle, rectangle)
  • Customizable dimensions
  • Smooth animation
  • TypeScript support
  • Lightweight and performant
  • Easy to integrate

Usage

import { Skeleton } from "@mohsensami/react-loading-skeleton";

function MyComponent() {
  return (
    <div>
      {/* Text skeleton */}
      <Skeleton width={200} height={20} variant="text" />

      {/* Circle skeleton */}
      <Skeleton width={40} height={40} variant="circle" />

      {/* Rectangle skeleton */}
      <Skeleton width={300} height={100} variant="rect" />
    </div>
  );
}

API Reference

Skeleton Component

The Skeleton component accepts the following props:

PropTypeDefaultDescription
widthnumber | string'100%'Width of the skeleton element. Can be a number (in pixels) or a string (e.g., '100%')
heightnumber | string'100%'Height of the skeleton element. Can be a number (in pixels) or a string (e.g., '100%')
variant'text' | 'circle' | 'rect''text'Shape variant of the skeleton
styleCSSProperties{}Additional CSS styles to apply to the skeleton
classNamestringundefinedAdditional CSS class name to apply to the skeleton

Examples

Basic Text Skeleton

<Skeleton width={200} height={20} variant="text" />

Profile Picture Skeleton

<Skeleton width={40} height={40} variant="circle" />

Card Skeleton

<Skeleton width={300} height={100} variant="rect" />

Complex Layout

<div style={{ display: "flex", gap: "16px", alignItems: "center" }}>
  <Skeleton width={40} height={40} variant="circle" />
  <div style={{ flex: 1 }}>
    <Skeleton
      width="100%"
      height={20}
      variant="text"
      style={{ marginBottom: "8px" }}
    />
    <Skeleton width="60%" height={16} variant="text" />
  </div>
</div>

License

MIT © Mohsen Sami

Keywords

react

FAQs

Package last updated on 05 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts