How to add react native skottie in a react-native app

How to add react native skottie in a react-native app

ยท

1 min read

In this short tutorial we are going to implement a react native skottie (a lottie library alternative).

Skottie is a high performance library for running Lottie animations in Skia. ๐Ÿ“„ Supports Lottie files (JSON) and DotLottie files (.lottie) ๐Ÿ“ˆ Uses Skias GPU-acceleration ๐Ÿ“‰ Lower CPU usage ๐Ÿƒ Higher frame rates ๐Ÿ”— Based on @shopify/react-native-skia.

๐Ÿƒ First install @shopify/react-native-skia since skottie is ๐Ÿ”— Based on @shopify/react-native-skia.

Then install react-native-skottie :

npm install react-native-skottie

Here is the rest of the code


import {StyleSheet, Text, View} from 'react-native';
import React from 'react';
import LottiesAnimation from './animation.json';
import {Skottie} from 'react-native-skottie';

const App = () => {
  return (
    <View>
      <Skottie
        style={{width: 350, height: 350}}
        source={LottiesAnimation}
        autoPlay={true}
      />
    </View>
  );
};

export default App;
ย