https://github.com/pioner92/react-native-auto-skeleton
🚀 Automatically generates skeleton based on your existing UI layout without manual configuration.
https://github.com/pioner92/react-native-auto-skeleton
fabric loader native-component react-native react-native-loader react-native-placeholder react-native-skeleton react-native-ui skeleton skeleton-loader
Last synced: about 2 months ago
JSON representation
🚀 Automatically generates skeleton based on your existing UI layout without manual configuration.
- Host: GitHub
- URL: https://github.com/pioner92/react-native-auto-skeleton
- Owner: pioner92
- License: mit
- Created: 2025-03-22T12:15:43.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-24T19:36:11.000Z (about 2 months ago)
- Last Synced: 2025-03-24T19:36:21.520Z (about 2 months ago)
- Topics: fabric, loader, native-component, react-native, react-native-loader, react-native-placeholder, react-native-skeleton, react-native-ui, skeleton, skeleton-loader
- Language: Swift
- Homepage:
- Size: 3.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-auto-skeleton
**`react-native-auto-skeleton`** Provides automatic skeleton loading indicators based on your existing UI components, without manual configuration..
⚠️ **Currently supports only iOS. Android support is coming soon.**
## Demo
![]()
## Installation
Using npm:
```bash
npm install react-native-auto-skeleton
```Using yarn:
```bash
yarn add react-native-auto-skeleton
```## Usage
Here's a quick example to get started:
```tsx
import { AutoSkeletonView, AutoSkeletonIgnoreView } from 'react-native-auto-skeleton';
......YOUR VIEWS
// Content that will be ignored by the skeleton
... Views without skeleton
```
Full example
```tsx
import { AutoSkeletonView } from 'react-native-auto-skeleton';interface IProfile {
name: string;
jobTitle: string;
avatar: string;
}const getProfile = async (): Promise => {
// Fetch profile data from your API
};export default function App() {
const [isLoading, setIsLoading] = useState(true);
const [profile, setProfile] = useState({} as IProfile);useEffect(() => {
(async () => {
const res = await getProfile();
setProfile(res);
setIsLoading(false);
})();
}, []);return (
{profile.name}
{profile.jobTitle}
{/* This buttons block will have skeleton applied */}
Add
Delete
{/* Alternatively, to exclude buttons from skeleton rendering: */}
...
);
}
```## API
| Prop | Type | Default | Description |
|---------------------------|---------|---------|-----------------------------------------------------------------------------------------------|
| `isLoading` | boolean | — | Enables or disables the skeleton state. When `true`, skeleton placeholders will be shown. |
| `shimmerSpeed` | Float | `1.0` | Duration of one shimmer animation cycle **in seconds**. Lower values = faster shimmer. |
| `shimmerBackgroundColor` | string | `#C7C7CC` | Background color of skeleton shapes in **hex format** (e.g., `#E0E0E0`). |
| `defaultRadius` | Float | `4` | Default corner radius for skeleton elements that don't have a defined `borderRadius`. |## Best Practices
- For rapid implementation, wrap entire UI sections with ``.
- For precise control, wrap individual UI components or groups separately.
- Ensure components have clearly defined dimensions, backgrounds, or styles for optimal skeleton rendering.
- To exclude specific components from skeleton rendering, wrap them with ``. Any content inside this wrapper will not be processed by the skeleton system.## License
[MIT](LICENSE)