Emotion
CSS-in-JS library for styling React components with scoped styles and theming.
3. Used by agents' projects
Dependency in 116 public GitHub projects set up for AI coding agents that we scanned (1.9%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Emotion does
Emotion ships as a framework-agnostic <code>css</code>/<code>cx</code> package that needs no setup, and a separate React package whose <code>css</code> prop comes with theming and server rendering the docs describe as zero-config.
Emotion popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Emotion is used
- Emotion is a dependency in 116 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.4% of the 4,867 JavaScript/TypeScript ones), #3 of 53 in styling and css.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 495; those are left out of every share on this page.
- The most used alternative in our scan is styled-components (19 projects).
- Projects that use it most often also use React (97.4%), React Hook Form (52.6%), Material UI (50.9%).
By coding agent
Often used with
Emotion in practice
Strengths
The docs say the <code>css</code> prop is like <code>style</code> but also handles vendor prefixes, nested selectors and media queries. You can style elements directly, without first defining styled components.
The <code>css</code> prop also accepts a function. That function is called with your theme, which gives you shared values where you write the styles.
For the React package, the docs list server-side rendering "with zero configuration" and theming that "works out of the box". They also mention ESLint plugins that check patterns and configuration.
The docs say the framework-agnostic package needs no extra setup, no Babel plugin and no other config changes. It still supports vendor prefixes, nested selectors and media queries.
Watch out for
The docs say server-side rendering with the framework-agnostic package "requires additional work to set up". They list zero-config SSR as a feature of <code>@emotion/react</code>.
<code>@emotion/react</code> requires React. The docs call it "Best when using React with a build environment that can be configured."
The install command in the docs for <code>@emotion/styled</code> also installs <code>@emotion/react</code>.
README quick start: the css prop
/** @jsx jsx */
import { jsx } from '@emotion/react'
let SomeComponent = props => {
return (
<div css={{ color: 'hotpink' }} {...props} />
)
}More about Emotion
Funding
- Open Collective: https://opencollective.com/emotion
Agent Skills for it
- react-modernization: Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing R
- react-native-dev: React Native and Expo development guide covering components, styling, animations, navigation, state management, forms, networking, performan
- react-expert: Use when building React 18+ applications in .jsx or .tsx files, Next.js App Router projects, or create-react-app setups. Creates components,
- react-vite-dashboard: Convert Stitch designs into production React + Vite dashboards with TanStack Query, accessible tokens from DESIGN.md, and Web3-ready pattern
- react-composition-patterns: React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component librarie
- react-hook-form: React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, useFieldArray, the subscrib
Packages around it
- @emotion/styled: styled.div component API
- @emotion/is-prop-valid: @emotion/is-prop-valid
- @emotion/cache: Emotion cache package
- @emotion/server: Emotion server rendering package
- @emotion/css: Framework-agnostic css and cx
- @emotion/babel-plugin: Optional Babel plugin
Alternatives
Emotion This page
CSS-in-JS library for styling React components with dynamic scoped styles.
Get started
Install it.
npm install @emotion/reactRules for your agent
## Emotion
- In React projects, prefer `@emotion/react`; the docs recommend it for React users "if possible".
- For the `css` prop, follow the README quick start: it shows a `/** @jsx jsx */` pragma and `import { jsx } from '@emotion/react'` at the top of the file.
- When adding `@emotion/styled`, install it together with `@emotion/react`, as the docs do.
- Outside React, use `@emotion/css`: call `css` to generate class names and `cx` to compose them.
- If a project uses `@emotion/css` with server rendering, expect setup work; the docs say SSR there "requires additional work to set up".
- To read theme values in the `css` prop, pass a function; the docs say it is called with the theme.
- Do not add the Babel plugin by default; the README says it is not required and links a feature table describing what it enables.