styled-anime
is simple library for create animatable styled component.
yarn add styled-anime
or
npm i styled-anime
import * as React from "react";
import { render } from "react-dom";
const MovingBox = styledAnime.div`
width: 100px;
height: 100px;
background: #ddd;
`(function() {
// Write your animation code like using 'animejs, anime({ ... })'
return {
loop: true,
duration: 3000,
tarnsformX: [0, 50, 0]
};
});
const container = document.getElementById("container");
render(<MovingBox />, container);
here: index.d.ts