Skip to content

Instantly share code, notes, and snippets.

@marshallmurphy
Created July 5, 2021 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshallmurphy/c632015c70d967ba6885828fb8c76a8b to your computer and use it in GitHub Desktop.
Save marshallmurphy/c632015c70d967ba6885828fb8c76a8b to your computer and use it in GitHub Desktop.
import Lottie from 'react-lottie-segments';
import animationData from './lotties/toggle.json';
import './App.css';
function App() {
const options = {
loop: true,
autoplay: true,
animationData: animationData,
rendererSettings: {
preserveAspectRatio: "xMidYMid slice"
}
};
return (
<div className="App">
<Lottie
options={options}
height={400}
width={400}
/>
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment