Last active
August 5, 2018 22:09
-
-
Save hpierre74/807bc4ddb89d795e0e8efd4a5a51c65b to your computer and use it in GitHub Desktop.
styled-components / react-animations helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import styled, { keyframes } from 'styled-components'; | |
const AnimatedComponent = styled.div` | |
animation: 1.5s ${keyframes({ from: { width: '0%' }, to: { width: '100%' } })} linear; | |
`; | |
const YourComponent = () => <AnimatedComponent>I am animated</AnimatedComponent>; | |
export default YourComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment