# vue-lottie

> Lottie Animation View for Vue

Latest version **0.2.1** (published 2018-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-lottie
pnpm add vue-lottie
yarn add vue-lottie
bun add vue-lottie
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-04-02 |
| First published | 2017-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1312 |
| Author | CHEN Qing |
| Maintainers | qchen |
| Keywords | vue, lottie, vue-component, vue-animation |

## Links

- npm: https://www.npmjs.com/package/vue-lottie
- Repository: https://github.com/chenqingspring/vue-lottie
- Homepage: https://github.com/chenqingspring/vue-lottie#readme
- Issues: https://github.com/chenqingspring/vue-lottie/issues
- npm.io page: https://npm.io/package/vue-lottie

## Dependencies (1)

- [lottie-web](https://npm.io/package/lottie-web.md) ^5.1.9

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2018-04-02
- 0.2.0 — 2018-04-02
- 0.1.2 — 2017-12-06
- 0.1.1 — 2017-12-06
- 0.1.0 — 2017-07-07
- 0.0.4 — 2017-05-03
- 0.0.2 — 2017-05-03
- 0.0.1 — 2017-05-03

## README

# Lottie Animation View for Vue ([React](https://github.com/chenqingspring/react-lottie), [Angular](https://github.com/chenqingspring/ng-lottie))

[![npm version](https://badge.fury.io/js/vue-lottie.svg)](http://badge.fury.io/js/vue-lottie)

Generated by [create-vue-component](https://github.com/chenqingspring/create-vue-component)

## Wapper of bodymovin.js

[bodymovin](https://github.com/bodymovin/bodymovin) is [Adobe After Effects](http://www.adobe.com/products/aftereffects.html) plugin for exporting animations as JSON, also it provide bodymovin.js for vender them as svg/canvas/html.

## Demo
https://chenqingspring.github.io/vue-lottie

## Why Lottie?

#### Flexible After Effects features
We currently support solids, shape layers, masks, alpha mattes, trim paths, and dash patterns. And we’ll be adding new features on a regular basis.

#### Manipulate your animation any way you like
You can go forward, backward, and most importantly you can program your animation to respond to any interaction.

#### Small file sizes
Bundle vector animations within your app without having to worry about multiple dimensions or large file sizes. Alternatively, you can decouple animation files from your app’s code entirely by loading them from a JSON API.

[Learn more](http://airbnb.design/introducing-lottie/) › http://airbnb.design/lottie/

Looking for lottie files › https://www.lottiefiles.com/


## Installation

Install through npm:
```
npm install --save vue-lottie
```

## Usage

```vue
<template>
    <div id="app">
        <lottie :options="defaultOptions" :height="400" :width="400" v-on:animCreated="handleAnimation"/>
        <div>
            <p>Speed: x{{animationSpeed}}</p>
            <input type="range" value="1" min="0" max="3" step="0.5"
                   v-on:change="onSpeedChange" v-model="animationSpeed">
        </div>
        <button v-on:click="stop">stop</button>
        <button v-on:click="pause">pause</button>
        <button v-on:click="play">play</button>
    </div>
</template>

<script>
  import Lottie from './lottie.vue';
  import * as animationData from './assets/pinjump.json';

  export default {
    name: 'app',
    components: {
      'lottie': Lottie
    },
    data() {
      return {
        defaultOptions: {animationData: animationData},
        animationSpeed: 1
      }
    },
    methods: {
      handleAnimation: function (anim) {
        this.anim = anim;
      },

      stop: function () {
        this.anim.stop();
      },

      play: function () {
        this.anim.play();
      },

      pause: function () {
        this.anim.pause();
      },

      onSpeedChange: function () {
        this.anim.setSpeed(this.animationSpeed);
      }
    }
  }
</script>

```
## Configuration

You can pass a configuration object through `options` property:
* animationData: an Object with the exported animation data.
* path: the relative path to the animation object. (animationData and path are mutually exclusive)
* loop: true / false / number
* autoplay: true / false it will start playing as soon as it is ready
* name: animation name for future reference
* renderer: 'svg' / 'canvas' / 'html' to set the renderer
* container: the dom element on which to render the animation

More information on [Bodymoving Documentation](https://github.com/bodymovin/bodymovin)

## Related Projects

* [Bodymovin](https://github.com/bodymovin/bodymovin) vue-lottie is a wrapper of bodymovin
* [Angular Lottie](https://github.com/chenqingspring/ng-lottie) angular implementation
* [React Lottie](https://github.com/chenqingspring/react-lottie) react implementation
* [React Native Lottie](https://github.com/airbnb/lottie-react-native) react native implementation by airbnb
* [IOS Lottie](https://github.com/airbnb/lottie-ios) ios implementation by airbnb
* [Android Lottie](https://github.com/airbnb/lottie-android) android implementation by airbnb

## Contribution

Your contributions and suggestions are heartily welcome.

## License
MIT

---
_Source: https://npm.io/package/vue-lottie · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
