1.1.1 • Published 6 months ago

rn-skeletons v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

šŸ’€ rn-skeletons

A powerful, highly customizable skeleton loading library for React Native applications.

šŸ“ø Preview

šŸš€ Features

  • šŸŽØ Fully Customizable Components
  • šŸ”¬ Multiple Skeleton Types
  • 🌈 Advanced Animation Options
  • šŸ“± Responsive Design
  • ♿ Accessibility Support
  • šŸ’Ø Lightweight & Performance-Optimized
  • šŸŒ“ Dark/Light Mode Compatible
  • šŸ”„ Multiple Animation Types

šŸ“¦ Installation

npm install rn-skeletons
# or
yarn add rn-skeletons
# or
pnpm add rn-skeletons

šŸ›  Basic Usage

import React from "react";
import { SkeletonText, SkeletonImage, SkeletonButton } from "rn-skeletons";

function LoadingScreen() {
  return (
    <View>
      <SkeletonText lines={3} lineHeight={20} spacing={10} />

      <SkeletonImage width={200} height={200} borderRadius={10} />

      <SkeletonButton width="100%" height={50} />
    </View>
  );
}

🌈 Comprehensive Component List

1. Base Skeleton Props

Common props for all skeleton components:

PropTypeDefaultDescription
widthnumber\|string'100%'Width of skeleton
heightnumber50Height of skeleton
backgroundColorstring'#E1E9EE'Background color
highlightColorstring'#F2F8FC'Shimmer color
borderRadiusnumber4Corner radius
animationType'shimmer'\|'pulse'\|'fade'\|'none''shimmer'Animation style
durationnumber1500Animation duration (ms)
styleViewStyle{}Additional styles
testIDstringundefinedTest identifier

2. Text Skeleton

Create multi-line text placeholders

Text Skeleton Props

PropTypeDefaultDescription
linesnumber1Number of text lines
lineHeightnumber20Height of each line
spacingnumber10Space between lines
widthnumber\|string'100%'Width of text skeleton
<SkeletonText
  lines={3} // Number of lines
  lineHeight={20} // Height of each line
  spacing={10} // Space between lines
  width="90%" // Width of text
  backgroundColor="#F0F0F0"
/>

3. Image Skeleton

Placeholder for images

Image Skeleton Props

PropTypeDefaultDescription
widthnumber200Image width
heightnumber200Image height
borderRadiusnumber10Corner radius
<SkeletonImage
  width={200} // Image width
  height={200} // Image height
  borderRadius={10} // Corner radius
  animationType="pulse"
/>

4. Button Skeleton

Placeholder for buttons

Button Skeleton Props

PropTypeDefaultDescription
widthnumber\|string'100%'Button width
heightnumber50Button height
borderRadiusnumber8Corner radius
<SkeletonButton
  width="100%" // Button width
  height={50} // Button height
  borderRadius={8} // Corner radius
  backgroundColor="#E0E0E0"
/>

5. Carousel Skeleton

Horizontal/vertical carousel loader

Carousel Skeleton Props

PropTypeDefaultDescription
itemCountnumber3Number of items
itemWidthnumber200Item width
itemHeightnumber150Item height
horizontalbooleantrueScroll direction
spacingnumber10Space between items
<SkeletonCarousel
  itemCount={3} // Number of items
  itemWidth={200} // Item width
  itemHeight={150} // Item height
  horizontal={true} // Scroll direction
  spacing={10} // Space between items
/>

6. Review Skeleton

Review card placeholder

Review Skeleton Props

PropTypeDefaultDescription
avatarSizenumber50Size of avatar
textLinesnumber2Number of text lines
<SkeletonReview
  avatarSize={50} // Avatar size
  textLines={2} // Text lines
  backgroundColor="#F5F5F5"
/>

7. Grid Skeleton

Grid-based layout skeleton

Grid Skeleton Props

PropTypeDefaultDescription
columnsnumber2Number of columns
itemHeightnumber150Item height
spacingnumber10Space between items
itemWidthnumber\|string'45%'Width of each item
<SkeletonGrid
  columns={2} // Number of columns
  itemHeight={150} // Item height
  spacing={10} // Space between items
  itemWidth="45%" // Width of grid items
/>

8. List Skeleton

List-based skeleton loader

List Skeleton Props

PropTypeDefaultDescription
itemCountnumber5Number of items
itemHeightnumber80Height of each item
spacingnumber10Space between items
<SkeletonList
  itemCount={5} // Number of items
  itemHeight={80} // Item height
  spacing={10} // Space between items
/>

šŸŽØ Advanced Customization

Animation Control

Customize animation for each skeleton:

<SkeletonText
  animationType="pulse" // Options: shimmer, pulse, fade, none
  duration={1500} // Animation duration in ms
  highlightColor="#E0E0E0"
/>

🌐 Responsive Design

Support for dynamic sizing:

<SkeletonText
  width="90%" // Percentage width
  lineHeight={20} // Fixed line height
/>

šŸš€ Performance Optimization

  • Minimal render overhead
  • Native animation driver
  • Lightweight implementation
  • Efficient memory management

šŸ”§ Troubleshooting

  • Ensure correct package installation
  • Check React Native version compatibility
  • Verify import statements

šŸ¤ Contributing

  1. Fork the repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Open Pull Request

šŸ“„ License

MIT License

šŸ“ž Contact

Your Name/Organization


⭐ Star the project if you find it helpful!

1.1.1

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago