Skip to content

Instantly share code, notes, and snippets.

@silkstudio
Last active December 3, 2020 09:05
Show Gist options
  • Select an option

  • Save silkstudio/e351858075eb95176e1f0d7761c0bca3 to your computer and use it in GitHub Desktop.

Select an option

Save silkstudio/e351858075eb95176e1f0d7761c0bca3 to your computer and use it in GitHub Desktop.
How to use Styled Components in conjunction with Framer Motion
import styled from "styled-components"
import { motion } from "framer-motion"
const StyledMotionComponent = styled(motion.div)`
/* ----- your styles go here ---- */
`
/**
* initial, animate and exit props can now be passed
* to this component just like a normal motion.div
*
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment