Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@lottiefiles/lottie-player
Advanced tools
This is a Web Component for easily embedding and playing Lottie animations in websites.
View editable examples on CodeSandBox
<script src="https://unpkg.com/@lottiefiles/lottie-player@0.0.5/dist/lottie-player.js"></script>
<script src="/node_modules/@lottiefiles/lottie-player/dist/lottie-player.js"></script>
npm install --save @lottiefiles/lottie-player
import '@lottiefiles/lottie-player';
Add the element lottie-player
and set the src
property to a URL pointing to a valid Bodymovin JSON.
<lottie-player
autoplay
controls
loop
mode="normal"
src="https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json"
style="width: 320px"
>
</lottie-player>
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
autoplay | autoplay | Autoplay animation on load. | boolean | false |
background | background | Background color. | string | undefined |
controls | controls | Show controls. | boolean | false |
count | count | Number of times to loop animation. | number | undefined |
direction | direction | Direction of animation. | number | 1 |
hover | hover | Whether to play on mouse hover. | boolean | false |
loop | loop | Whether to loop animation. | boolean | false |
mode | mode | Play mode. | PlayMode.Bounce | PlayMode.Normal | PlayMode.Normal |
renderer | renderer | Renderer to use. | "svg" | 'svg' |
speed | speed | Animation speed. | number | 1 |
src (required) | src | Bodymovin JSON data or URL to JSON. | string | undefined |
getLottie() => Promise<any>
Returns the instance of lottie player used in the component.
Type: Promise<any>
pause() => void
Pause animation play.
Type: void
play() => void
Start playing animation.
Type: void
setDirection(value: number) => void
Animation play direction.
Name | Type | Description |
---|---|---|
value | number | Direction values. |
Type: void
setLooping(value: boolean) => void
Sets the looping of the animation.
Name | Type | Description |
---|---|---|
value | boolean | Whether to enable looping. Boolean true enables looping. |
Type: void
setSpeed(value?: number) => void
Sets animation play speed.
Name | Type | Description |
---|---|---|
value | number | Playback speed. |
Type: void
stop() => void
Stops animation play.
Type: void
seek(value: number | string) => void
Seek to a given frame. Frame value can be a number or a percent string (e.g. 50%).
Type: void
snapshot(download?: boolean) => string
Snapshot the current frame as SVG. If 'download' argument is boolean true, then a download is triggered in browser.
Type: string
toggleLooping() => void
Toggles animation looping.
Type: void
togglePlay() => void
Toggle playing state.
Type: void
Custom property | Description | Default |
---|---|---|
--lottie-player-toolbar-height | Toolbar height | 35px |
--lottie-player-toolbar-background-color | Toolbar background color | transparent |
--lottie-player-toolbar-icon-color | Toolbar icon color | #999 |
--lottie-player-toolbar-icon-hover-color | Toolbar icon hover color | #222 |
--lottie-player-toolbar-icon-active-color | Toolbar icon active color | #555 |
--lottie-player-seeker-track-color | Seeker track color | #CCC |
--lottie-player-seeker-thumb-color | Seeker thumb color | rgba(0, 107, 120, 0.8) |
MIT License © LottieFiles.com
FAQs
Lottie animation and Telegram Sticker player web components.
We found that @lottiefiles/lottie-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.