# Skeleton
Loading skeleton with shimmer animation for placeholder content.
## Features
- ✅ Shimmer animation
- ✅ 3 variants: rect, circle, text
- ✅ Custom dimensions and colors
- ✅ SkeletonGroup for layouts
- ✅ Built with Reanimated
## Installation
```bash
npx @memoro/ui add skeleton
```
**Dependencies:** `react-native-reanimated`
## Usage
### Rectangle (Default)
```tsx
import { Skeleton } from '@/components/ui/Skeleton';
```
### Circle (Avatar)
```tsx
```
### Text Line
```tsx
```
### Custom Colors
```tsx
```
### Card Skeleton
```tsx
```
### List Skeleton
```tsx
{Array.from({ length: 5 }).map((_, i) => (
))}
```
### Image Grid Skeleton
```tsx
{Array.from({ length: 6 }).map((_, i) => (
))}
```
## Props
### Skeleton
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `width` | `number \| string` | `'100%'` | Width of skeleton |
| `height` | `number \| string` | `20` | Height of skeleton |
| `borderRadius` | `number` | - | Border radius (auto for variants) |
| `backgroundColor` | `string` | `'#E5E7EB'` | Base color |
| `shimmerColor` | `string` | `'#F3F4F6'` | Shimmer overlay color |
| `duration` | `number` | `1500` | Animation duration (ms) |
| `style` | `ViewStyle` | - | Additional styles |
| `variant` | `'rect' \| 'circle' \| 'text'` | `'rect'` | Skeleton shape |
### SkeletonGroup
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `children` | `ReactNode` | - | Skeleton elements |
| `spacing` | `number` | `12` | Gap between elements |
| `style` | `ViewStyle` | - | Container styles |
## Variants
| Variant | Default Radius | Use Case |
|---------|---------------|----------|
| `rect` | 8px | Images, cards, boxes |
| `circle` | 50% | Avatars, icons |
| `text` | 4px | Text lines |
## Examples
### Profile Card Skeleton
```tsx
{/* Avatar */}
{/* Name */}
{/* Bio */}
{/* Stats */}
```
### Article Skeleton
```tsx
{/* Cover image */}
{/* Title */}
{/* Meta */}
{/* Content */}
```
## Default Colors
- **Background:** `#E5E7EB` (gray-200)
- **Shimmer:** `#F3F4F6` (gray-100)
## Animation
- Pulses from 30% → 60% → 30% opacity
- Duration: 1500ms
- Infinite loop
## Dependencies
- `react-native-reanimated` (v3+)
## Notes
- Uses Reanimated for smooth 60fps animation
- Shimmer color should be lighter than background
- Use SkeletonGroup for consistent spacing
- Supports percentage widths