Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/murongg/v-lottie

Vue composables for Lottie
https://github.com/murongg/v-lottie

Last synced: about 2 months ago
JSON representation

Vue composables for Lottie

Awesome Lists containing this project

README

        

# v-lottie

Vue composables for [Lottie](https://github.com/airbnb/lottie-web)!

[![NPM version](https://img.shields.io/npm/v/v-lottie?color=a1b858&label=)](https://www.npmjs.com/package/v-lottie)

## Usage

```bash
npm install v-lottie
```

```vue

import { onMounted } from 'vue'
import { useLottie } from 'v-lottie'
const el = ref(null)
onMounted(() => {
const animation = useLottie(el)
})

```

## Type Declarations

```ts
export type MaybeRef = Ref | T
export type MaybeRefValues = {
[K in keyof T]: MaybeRef
}
export type AnimationConfigOmitContainer = Omit
export type UseLottieMix, B extends AnimationConfig<'svg'>> =
(AnimationConfigOmitContainer
| AnimationConfigOmitContainer) & UseLottieOtherOptions

export interface UseLottieOtherOptions {
speed: number
direction: AnimationDirection
}
export type UseLottieOptions = UseLottieMix
export function useLottie(el: MaybeRef, options: MaybeRefValues): AnimationItem
```