Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ahgsql/remotion-lottie

Lottie / Bodymovin Controller for Remotion
https://github.com/ahgsql/remotion-lottie

Last synced: about 23 hours ago
JSON representation

Lottie / Bodymovin Controller for Remotion

Awesome Lists containing this project

README

        

# Remotion Lottie

Lottie / Bodymovin Controller for Remotion.

![npm bundle size](https://img.shields.io/bundlephobia/min/remotion-lottie) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/remotion-lottie) [![npm downloads](https://img.shields.io/npm/dt/remotion-keyframes)](https://www.npmjs.com/package/remotion-lottie) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE)

## Installation

```bash

npm install remotion-lottie

```

or

```bash

yarn add remotion-lottie

```

## Usage

Load your animation into **Lottier** Component.

### Load Library and Lottie JSON file

```jsx
import { Lottier, useLottie } from "remotion-lottie";

import data from "./animationData.json";
```

#### Props

- **data**: Pass loaded animation data **Required**

- **fitMode** : "fitToWidth" , "fitToHeight" , "fitToContent" **Not Required**

- **stayAtLastFrame** : true or false, if true animation will stay on its last frame. **false by default**

```jsx
import { Sequence, useCurrentFrame } from "remotion";
import { Lottier, useLottie } from "remotion-lottie";
import data from "./11.json";

export const HiLottie = () => {
return (



);
};
```

## useLottie

useLottie(data) is small helper to get information about animation.
You can use it to determine **Composition size** or **Sequence durationInframes** props.

```jsx
let { w, h, op, fr } = useLottie(data);
```

```jsx
let { op } = useLottie(data);
return (



);
```

## License

MIT © [ahgsql](https://github.com/ahgsql)