1.0.4 ⢠Published 6 months ago
rn-skeleton-loading v1.0.4
š¬ Demo
𦓠rn-skeleton-loading
A lightweight, customizable, and fast skeleton loading component for React Native.
š„ Supports shimmer animation & fully customizable UI elements.
š Installation
You can install it using npm or yarn:
npm install rn-skeleton-loading
or
yarn add rn-skeleton-loading
š„ Usage
Here is a basic usage example:
import { Skeleton } from "rn-skeleton-loading";
import { View } from "react-native";
export default function App() {
return (
<View style={{ padding: 20 }}>
<Skeleton width="90%" height={20} />
<Skeleton width="80%" height={20} />
<Skeleton width={60} height={60} borderRadius={30} />
</View>
);
}
šØ Customization
You can customize the skeleton UI by passing props.
Prop | Type | Default | Description |
---|---|---|---|
width | string / number | "100%" | Width of the skeleton |
height | number | 20 | Height of the skeleton |
borderRadius | number | 4 | Border radius |
color | string | "#E0E0E0" | Base color of the skeleton |
highlightColor | string | "#F5F5F5" | Shimmer effect color |
duration | number | 1000 | Duration of shimmer animation in ms |
š Advanced Example (With Custom Props)
import { Skeleton } from "rn-skeleton-loading";
import { View } from "react-native";
export default function ProfileSkeleton() {
return (
<View style={{ padding: 20 }}>
<Skeleton width={100} height={100} borderRadius={50} color="#ccc" />
<Skeleton width="80%" height={15} style={{ marginTop: 10 }} />
<Skeleton width="60%" height={15} style={{ marginTop: 5 }} />
</View>
);
}
ā Features
ā Lightweight & Fast
ā Customizable Width, Height, Colors, Border Radius
ā Works on both iOS & Android
ā Supports shimmer animation
ā Perfect for loading states in lists, cards, and avatars
š¤ Contributing
Pull requests are welcome! If you find a bug or have a feature request, please open an issue. š
š License
MIT License ā You are free to use, modify, and distribute this package!
š š” Happy Coding šš š