Emotion
emotion
The Next Generation of CSS-in-JS.
Animation
styles
emotion
react
css
css-in-js
Animation
javascript
npm
frontend
open source
Stars
18k
Weekly
776k
Open issues
400
Bundle
~25 kB
Installation
npm install emotionCode example
import { motion } from "emotion";
export function Example() {
return (
<motion.div
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.35 }}
>
<h2>Animated with Emotion</h2>
</motion.div>
);
}Pros & cons
Pros
- Actively maintained by Kye Hohenberger
- 776k weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~25 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 400 open issues on GitHub