Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/murongg/v-lottie
- Owner: murongg
- License: mit
- Created: 2022-06-19T12:16:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-21T01:32:10.000Z (over 2 years ago)
- Last Synced: 2024-04-24T16:58:50.152Z (5 months ago)
- Language: TypeScript
- Size: 60.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
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) & UseLottieOtherOptionsexport interface UseLottieOtherOptions {
speed: number
direction: AnimationDirection
}
export type UseLottieOptions = UseLottieMix
export function useLottie(el: MaybeRef, options: MaybeRefValues): AnimationItem
```