BASE

Emotion

Emotion

UI library · Free

A CSS-in-JS library with themes and dynamic styles: it connects component appearance to application state and design tokens.

Also known as: emotion-js/emotion; emotionjs; emotion-css-in-js

Resource illustration: Emotion

Open resource ↗

What you can use for free

Code and local use under MIT.

Paid features and costs

Computing resources, self-hosting, and external services are paid for separately if used.

Access and limitations

Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.

Use cases

  • Connect React component styles to theme and state
  • Apply dynamic styles for component states and check the resulting appearance

Example workflow

A possible workflow; this is not a report of hands-on testing.

Connect React component styles to theme and state.

Before you start

  • The component's design, states, and data.
  • A compatible framework and the project's styles.

Steps

  1. Define theme tokens and the selected component's styles.
  2. Apply dynamic styles for component states and check the resulting appearance.
  3. Configure styles and check empty, loading, and error states.

Check your result

  • The keyboard, focus indicators, and a screen reader let users complete the action.
  • The component works on a narrow screen and with long data values.

Choosing Emotion

Connect React component styles to theme and state

Choose this when

  • Connect React component styles to theme and state
  • Apply dynamic styles for component states and check the resulting appearance

Things to consider

  • Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
  • Terms of use: MIT for the code; dependencies have separate licenses.
  • The Babel plugin is not a mandatory condition for using Emotion.

Frequently asked questions

What can you use for free in Emotion?

Code and local use under MIT.

What additional costs might arise with Emotion?

Computing resources, self-hosting, and external services are paid for separately if used.

What terms of use matter for Emotion?

MIT for the code; dependencies have separate licenses.

How do you get started with Emotion?

Define theme tokens and the selected component's styles. Apply dynamic styles for component states and check the resulting appearance. Configure styles and check empty, loading, and error states.

Is Emotion's Babel plugin mandatory?

No: the README explicitly calls it optional and links it to additional optimizations and settings. Styles can use strings or objects; the React quick start uses @emotion/react and the css prop.

License

MIT for the code; dependencies have separate licenses.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Technologies and topics

  • Emotion
  • UI
  • Development

Sources

Other resources