![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-lottie-hook
Advanced tools
Lottie react hook with runtime animation controls.
examples: · github · codesandbox ·
Lottie is a library for the Web, Android and iOS that parses Adobe After Effects animations through a plugin called bodymovin and exported as JSON; rendering natively on each platform.
Choose your package manager:
yarn add react-lottie-hook
npm i react-lottie-hook
This library main exports a useLottie
hook and supplies also a standard Lottie
component but you are not required to use the latter.
The useLottie
hook requires a configuration object of type LottieConfig
to be supplied to it and in return you will get an array with a ref to the animation container, state of the animation and the control actions, respectively.
import React from 'react';
import { useLottie, Lottie } from "react-lottie-hook";
import animationData from "./animation.json";
const App = () => {
const [lottieRef, { isPaused, isStopped }, controls] = useLottie({
renderer: "svg",
rendererSettings: {
preserveAspectRatio: "xMidYMid slice",
progressiveLoad: false,
},
animationData
})
return <Lottie lottieRef={ref} width={400} height={400} />
}
The exported Lottie
component has a type of LottieProps
and the minimum props it requires is a lottieRef
from the useLottie
hook.
Lottie Component props:
props | type | default |
---|---|---|
lottieRef: | React.MutableRefObject<HTMLElement | null> | |
width? | number | 200px |
height? | number | 200px |
style? | object | |
title? | string | |
className? | string | |
ariaRole? | string | |
ariaLabel? | string | |
onKeyDown? | (e: React.KeyboardEvent) => void | |
onClick? | (e: React.MouseEvent<HTMLElement, MouseEvent>) |
FAQs
React Lottie written with react hooks
The npm package react-lottie-hook receives a total of 0 weekly downloads. As such, react-lottie-hook popularity was classified as not popular.
We found that react-lottie-hook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.