
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@lottiefiles/vue-lottie-player
Advanced tools
This is a Vue component for the Lottie Web Player. This library is a vue wrapper around the LottieFiles Lottie Web Player
npm install --save @lottiefiles/vue-lottie-player
import LottieVuePlayer from "@lottiefiles/vue-lottie-player";
Vue.use(LottieVuePlayer);
Clone repo
run yarn install
Add the element lottie-vue-player
and set the src
prop to a URL pointing to a valid Lottie JSON. Full example of an App.vue file is shown below.
<template>
<div id="app">
<lottie-vue-player :src="`https://assets10.lottiefiles.com/packages/lf20_tzjfwgud.json`"
:theme="options.theme"
:player-size="options.playerSize"
:player-controls="true"
style="width: 100%; height:400px">
</lottie-vue-player>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
options: {
minimizable: false,
playerSize: "standard",
backgroundColor: '#fff',
backgroundStyle: 'color',
theme: {
controlsView: "standard",
active: "light",
light: {
color: '#3D4852',
backgroundColor: '#fff',
opacity: '0.7',
},
dark: {
color: '#fff',
backgroundColor: '#202020',
opacity: '0.7',
}
}
}
}
}
}
</script>
Prop | Description | Type | Default |
---|---|---|---|
autoplay | Autoplay animation on load. | boolean | false |
backgroundColor | Background color. | string | undefined |
playerControls | Show controls. | boolean | false |
showColorPicker | Show color picker | boolean | false |
playerSize | Player set size (hide, minimal, standard) | string | standard |
loop | Whether to loop animation. | boolean | false |
speed | Animation speed. | number | 1 |
style | The style for the container. | object | undefined |
src (required) | Bodymovin JSON data or URL to JSON. | object | string |
togglePlayPause() => void
Toggle animation play pause.
Type: void
toggleFullscreen() => void
Toggle full screen player.
Type: void
toggleLoop() => void
Toggle animation loop.
Type: void
setPlayerSpeed(speed?: number) => void
Sets animation play speed.
Name | Type | Description |
---|---|---|
value | number | Playback speed. |
Type: void
stop() => void
Stops animation play.
Type: void
setBackgroundColor(color: string) => void
set background color.
Type: void
MIT License © LottieFiles.com
FAQs
Lottie player wrapper for Vue.js by LottieFiles
The npm package @lottiefiles/vue-lottie-player receives a total of 3,733 weekly downloads. As such, @lottiefiles/vue-lottie-player popularity was classified as popular.
We found that @lottiefiles/vue-lottie-player demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.