Skeleton
Moti's skeleton component is great for showing animated loading states. It works on all platforms, including web.
Install#
The skeleton ships as its own package, since it has dependencies outside of moti:
- npm
- Yarn
You'll also want to install expo-linear-gradient.
Please note that you must have Reanimated 2 installed. See installation steps for more info.
If you're using Expo:#
If you aren't using Expo:#
- npm
- Yarn
Please make sure you complete any installation steps required for Expo's linear gradient component.
Video#
Usage#
Show/hide#
Skeleton will hide when data exists by default.
You can always show the skeleton:
Or hide it:
Border radius#
Use radius to show a circle, square, or custom border radius. Defaults to 8.
Circle#
Square#
Custom radius#
Color modes#
light or dark
Custom colors#
Custom animation delay#
Custom animation transition#
Full example#
Here's the code from the video above: