solid-lottie
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Solid Lottie

Solid wrapper of lottie-web.

Installation

Install using yarn

yarn add solid-lottie

Install using pnpm

pnpm install solid-lottie

Install using npm

npm install solid-lottie

Usage

import Lottie, { LottieRef } from 'solid-lottie';

const App: VoidComponent = () => {
  let lottieRef: LottieRef | undefined;

  const handleDataReady = () => {
    if (!lottieRef) return;

    lottieRef.play();
  };

  return (
    <>
      <Lottie path="/animation.json" loop ref={(v) => (ref = v)} onDataReady={() => handleDataReady()} />
    </>
  );
};

Documentation

You can read the lottie-web documentation to get more info about lottie.

More detailed documentation can be found here


Note about this project

It was done very quickly one evening before I needed it for another project and I figured I could share it with the rest of the world.

If you find any bugs or something screams that I don't know what I'm doing, tell me! I'll be more than happy to fix any issues and learn new things along the way.

Readme

Keywords

Package Sidebar

Install

npm i solid-lottie

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

57.5 kB

Total Files

20

Last publish

Collaborators

  • janvavrinek