Skeleton
Moti's skeleton component is great for showing animated loading states. It works on all platforms, including web.
#
InstallPrior to version 0.17.0
, the skeleton was installed as its own package. This is no longer the case.
If you have @motify/skeleton
in your package.json
, be sure to delete it and upgrade moti
.
#
Peer dependencyYou'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/hideSkeleton will hide when data exists by default.
You can always show
the skeleton:
Or hide it:
#
Border radiusUse radius
to show a circle, square, or custom border radius. Defaults to 8
.
#
Circle#
Square#
Custom radius#
Color modeslight
or dark
#
Custom animation delay#
Custom animation transition#
Full exampleHere's the code from the video above:
<Skeleton.Group />
#
If you have many skeleton components, you can now wrap them with a single <Skeleton.Group show={loading} />
component. This will help you achieve this type of effect.