flâneur — a map of the web's best reading

Emotion - The css Prop

emotion.sh · 1,249 words · saved by 1 readers

The primary way to style elements with emotion is the css prop. It provides a concise and flexible API to style your components.

Emotion – The css Prop 🇺🇦 STOP WAR IN UKRAINE 🇺🇦 The css Prop ✏️ Edit this page The primary way to style elements with emotion is the css prop. It provides a concise and flexible API to style your components. Get Started There are 2 ways to get started with the css prop. Babel Preset JSX Pragma Both methods result in the same compiled code. After adding the preset or setting the pragma as a comment, compiled jsx code will use emotion's jsx function instead of React.createElement . Input Output Before <img src="avatar.png" /> React.createElement('img', { src: 'avatar.png' }) After <img src=

Explore this link on the map →

related reading