Skeleton
Skeleton components provide loading placeholders with a subtle pulse animation. They match the shape of content being loaded, reducing perceived load time.
Preview
Section titled “Preview”Base Skeleton
Section titled “Base Skeleton”The fundamental skeleton with customizable dimensions.
<Skeleton width={80} height={80} borderRadius={8} /><Skeleton width={120} height={40} borderRadius={20} /><Skeleton width={40} height={40} borderRadius={40} />SkeletonText
Section titled “SkeletonText”Multi-line text placeholder with natural variation.
<SkeletonText lines={3} lastLineWidth="60%" />SkeletonStatCard
Section titled “SkeletonStatCard”For stat cards in dashboards.
SkeletonReadingItem
Section titled “SkeletonReadingItem”For reading list items with hexagram visual.
Full Screen Skeletons
Section titled “Full Screen Skeletons”ProfileScreenSkeleton
Section titled “ProfileScreenSkeleton”HistoryScreenSkeleton
Section titled “HistoryScreenSkeleton”API Reference
Section titled “API Reference”Skeleton Props
Section titled “Skeleton Props”| Prop | Type | Default | Description |
|---|---|---|---|
width | number | string | '100%' | Element width |
height | number | 20 | Element height |
borderRadius | number | 4 | Corner radius |
style | ViewStyle | - | Additional styles |
SkeletonText Props
Section titled “SkeletonText Props”| Prop | Type | Default | Description |
|---|---|---|---|
lines | number | 3 | Number of lines |
lineHeight | number | 16 | Height per line |
lastLineWidth | string | '60%' | Width of last line |
Animation
Section titled “Animation”The skeleton uses a subtle pulse animation:
const pulse = Animated.loop( Animated.sequence([ Animated.timing(pulseAnim, { toValue: 0.7, duration: 800, useNativeDriver: true, }), Animated.timing(pulseAnim, { toValue: 0.4, duration: 800, useNativeDriver: true, }), ]));| Property | Value |
|---|---|
| Duration | 800ms per phase (1.6s cycle) |
| Opacity Range | 0.4 - 0.7 |
| Driver | Native (60fps) |
Usage Guidelines
Section titled “Usage Guidelines”- Match skeleton shapes to actual content
- Use consistent skeleton heights for text
- Show skeletons briefly (under 3 seconds ideally)
- Combine with Suspense for data loading
- Use skeletons for instant actions
- Make skeletons too prominent
- Animate skeleton position (only opacity)
- Show skeletons for more than 10 seconds