Skeleton
The Skeleton component provides animated placeholders while content is loading. It supports different shapes and automatically adapts to dark mode.
Import
import { Skeleton, SkeletonProvider } from "react-native-ficus-ui";
Usage
Basic skeleton
Skeleton Box
Skeleton Text
Multi-line text skeleton
Skeleton Circle
Loading state with content
Synchronized animation with SkeletonProvider
Card layout example
Custom shimmer settings
Props
Skeleton
Extends every Box
props.
isLoaded
If true, the skeleton will be replaced by the children.
Type | Required | Default |
---|---|---|
boolean | No | false |
shimmer
If true, the skeleton will show a shimmer animation.
Type | Required | Default |
---|---|---|
boolean | No | true |
duration
The duration of the shimmer animation in milliseconds. Overrides provider duration.
Type | Required | Default |
---|---|---|
number | No | 1200 |
Skeleton.Text
Extends every Skeleton
props.
fontSize
The font size to calculate the skeleton height automatically.
Type | Required | Default |
---|---|---|
ResponsiveValue<string | number> | No | 'md' |
noOfLines
The number of lines to render for multi-line text skeleton.
Type | Required | Default |
---|---|---|
number | No | 1 |
lineSpacing
The spacing between lines when noOfLines > 1.
Type | Required | Default |
---|---|---|
ResponsiveValue<string | number> | No | 'xs' |
Skeleton.Circle
Extends every Skeleton
props.
boxSize
The size of the circle (both width and height).
Type | Required | Default |
---|---|---|
ResponsiveValue<number | string> | No | 40 |
SkeletonProvider
duration
The duration of the shimmer animation in milliseconds for all child skeleton components.
Type | Required | Default |
---|---|---|
number | No | 1200 |
paused
If true, the shimmer animation will be paused.
Type | Required | Default |
---|---|---|
boolean | No | false |
Accessibility
The Skeleton component includes proper accessibility features:
- Automatically sets appropriate
accessibilityLabel
when content is loading - Maintains proper screen reader support
- Respects user's reduced motion preferences
Styling
Skeleton components can be styled using all standard Ficus UI style props:
Performance
The Skeleton component is optimized for performance:
- Uses
react-native-reanimated
for 60fps animations - Pure React Native implementation - no external native dependencies
- Lightweight shimmer effect with minimal CPU usage
- Works perfectly in Expo Go and all React Native environments