Available animations

There are some built-in animations inside the library but you can create your own one if you need a specific one.

Fade

This is the base animation that makes the placeholder become clearer on a specified interval:

This is an example using react-native-web. If you want to run it on a real device, check this Snack project

ShineOverlay

This applies a tiny overlay from left to right of the placeholder. It's pretty neat but it has the drawback to only work without style customization: only on white background with gray lines.

This is an example using react-native-web. If you want to run it on a real device, check this Snack project

Shine

The shine animation is an attempt to overcome the overlay problem of the ShineOverlay animation by animating only the differnt part of the placeholder. It also has some drawbakcs. Since each component has a different width, the animation is more or less quick dependending on the host size. For this kind of animation to perfectly work, it would be necessary to determine when the left size placeholder has finished animating and only then start to animate the next one.

This is an example using react-native-web. If you want to run it on a real device, check this Snack project

Loader

A simple placeholder animation based on the standard loader (ActivityIndicator) of each platforms.

This is an example using react-native-web. If you want to run it on a real device, check this Snack project

Progressive

I'm feel a bit guilty about that but I've stolen the idea from a design system and I can't remember which one. But I like the way it behaves:

This is an example using react-native-web. If you want to run it on a real device, check this Snack project

Tweaking existing animations

It's possible to tweak a specific animation by passing it additional props. However keep in mind that it's important to spread the props from the Animation render function. Else you will be in strange behaviors:

This is an example using react-native-web. If you want to run it on a real device, check this Snack project

Build your own one

You can build your own animation and pass it to the Animation prop of the Placeholder component.

In fact, what you can build is a Provider of value for animations.

I suggest you take a look at the implementation of the Progressive animation implementation and try to create something that look like this, and then pass it to the Animation prop.