1.0.5 • Published 3 years ago

remotion-lottie v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Remotion Lottie

Lottie / Bodymovin Controller for Remotion.

npm bundle size npm bundle size npm downloads GitHub license

Installation

npm install remotion-lottie

or

yarn add remotion-lottie

Usage

Load your animation into Lottier Component.

Load Library and Lottie JSON file

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

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

export const HiLottie = () => {
  return (
    <Sequence from={0} durationInFrames={150}>
      <Lottier data={data} fitMode="fitToWidth" stayAtLastFrame={true} />
    </Sequence>
  );
};

useLottie

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

let { w, h, op, fr } = useLottie(data);
let { op } = useLottie(data);
return (
  <Sequence from={0} durationInFrames={op}>
    <Lottier data={data} fitMode="fitToWidth" stayAtLastFrame={true} />
  </Sequence>
);

License

MIT © ahgsql

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago