# Emotion — card for AI agents

CSS-in-JS library for styling React components with scoped styles and theming.

Category: Styling and CSS · npm package `@emotion/react` · latest version 11.14.0 (checked 2026-11-01)
Install: `npm install @emotion/react`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## 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.

## Agent Skills for it
- react-modernization from wshobson/agents: `npx skills add wshobson/agents --skill react-modernization`
- react-native-dev from MiniMax-AI/skills: `npx skills add MiniMax-AI/skills --skill react-native-dev`
- react-expert from Jeffallan/claude-skills: `npx skills add Jeffallan/claude-skills --skill react-expert`
- react-vite-dashboard from google-labs-code/stitch-skills: `npx skills add google-labs-code/stitch-skills --skill react-vite-dashboard`
- react-composition-patterns from tech-leads-club/agent-skills: `npx skills add tech-leads-club/agent-skills --skill react-composition-patterns`
- react-hook-form from midudev/autoskills: `npx skills add midudev/autoskills --skill react-hook-form`

## What it is
- Emotion is an MIT-licensed library for writing CSS in JavaScript. The GitHub repository dates from 2017 and describes it as "designed for high performance style composition". The README says it builds "on many other CSS-in-JS libraries" and accepts both string and object styles. The docs name glam, glamor, styled-components and glamorous as libraries that inspired it.
- The docs describe "two primary methods" of using it. `@emotion/css` is framework agnostic: its `css` function returns class names and `cx` composes them. `@emotion/react` requires React and adds a `css` prop to elements, along with theming and server rendering. `@emotion/styled` provides the `styled.div` pattern and is installed together with the React package.
- The docs recommend `@emotion/react` to React users "if possible", and call it "Best when using React with a build environment that can be configured." For other cases, they call `@emotion/css` "the simplest way to use Emotion".

## Caveats
- SSR takes extra work with @emotion/css: 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 `@emotion/react`.
- React package: best with a configurable build: `@emotion/react` requires React. The docs call it "Best when using React with a build environment that can be configured."
- styled comes with the React package: The install command in the docs for `@emotion/styled` also installs `@emotion/react`.
- Some optimizations live in an optional Babel plugin: The README says the Babel plugin is not required, but that it "enables some optimizations and customizations". It links to a feature table so you can decide whether you need it.

## Numbers (AgentGid data)
- Gid Score: 77.2 (#151 of all tools, 3 of 53 in its category)
- Used in 116 public projects set up for AI coding agents (1.9%)
- Downloads last week: 29,301,992 (as of 2026-11-24), +40.0% over 4 weeks
- GitHub stars: 18,037 (as of 2026-11-24)
- Last push: 2026-10-23

## Often used with
React 97.4%, React Hook Form 52.6%, Material UI 50.9%, date-fns 46.6%, Framer Motion 43.1%, Next.js 55.2%

## Checked alternatives (same job)
- styled-components: https://agentgid.com/tools/styled-components/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/emotion/
- Homepage: https://github.com/emotion-js/emotion/tree/main#readme
- Repository: https://github.com/emotion-js/emotion
- Source: https://github.com/emotion-js/emotion#readme
- Source: https://github.com/emotion-js/emotion
- Source: https://github.com/emotion-js/emotion/releases
- Source: https://emotion.sh/docs/introduction

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
