Why React forces a styling decision
CSS-in-JS is, in practice, mostly CSS-in-React. Most of these libraries describe themselves as framework-agnostic, but the bulk of their usage lands on React projects. The reason is that React has no blessed styling solution of its own: Vue ships style tags inside Single File Components, Svelte does the same, and Angular provides component-scoped styles. React is bring-your-own. Writing plain vanilla CSS files is a perfectly valid answer, and preferable to sprinkling inline style={{ }} on everything, but libraries offer real advantages:
- Co-locating styles with components
- Scoping styles to components
- Driving style variations from props
- Using JavaScript capabilities inside CSS syntax
- Theming
Authoring styles in JavaScript does not obligate you to ship them that way. Libraries labeled "zero runtime" usually mean the styles are compiled to CSS at build time and consumed like any other stylesheet, which is typically the better path for performance.
Full-featured runtime libraries
styled-components

- Probably the most-used option in the space.
- Popularized dynamic styling and using props for variations.
- Template literal syntax reads like CSS and seems to encourage that style, though object syntax is also supported.
- Supports SSR, but it is not zero runtime: it still ships a JavaScript runtime for dynamic styles.
Emotion

- Not wildly different from styled-components, though performance differences come up in discussion.
- Supports string and object styles, source maps, labels and testing utilities.
- Supports SSR; not zero-runtime.
- Glamorous is deprecated in favor of Emotion (as, presumably, are Glam and Glamor).
JSS

- A React-specific integration is available.
- Offers an
extendsyntax. - Built on a plugin architecture.
Goober

- Weighs just 1.25KB, roughly an order of magnitude smaller than the alternatives.
- Covers pretty much the same feature set as styled-components and Emotion.
Component-scoped and build-time approaches
CSS Modules

- Deliberately simple: it scopes styles and encourages co-location, nothing more.
- Its standout feature is composition, essentially mixins built from existing classes.
- Not a runtime tool at all; it requires a build step, though HMR still works. Styles can ship inside JavaScript or be extracted into static CSS files, and since nothing is dynamic, extraction makes it extremely zero runtime.
- Works alongside Sass, and is built into Next.js.
Stitches

- The Variants API is well executed and genuinely useful.
- Strong TypeScript editor experience, theming support and an emphasis on design tokens.
- Utilities let you define custom shorthands.
- Supports SSR and sits closer to zero runtime, but isn't fully there. Rather than generating CSS files, it exposes a function that emits CSS for a
<style>tag — questionable for caching.
vanilla-extract

- Support for SSR understates it: static compilation is the only mode unless you opt into specific runtime features such as dynamic theming. That is what zero runtime means here — output is static CSS files.
- Strong TypeScript editor experience.
- Has a Variants API and a Recipes API comparable to Stitches.
- Theming and a utility-class-like approach are available through Sprinkles.
- Aphrodite covers similar ground, but its creators are moving to vanilla-extract, which makes it a poor choice today.
Linaria

- The original zero-runtime CSS-in-JS library.
- Compiles to real CSS files, though dynamic usage still involves a runtime.
- API feels similar to styled-components; supports Critical CSS.
Styled JSX

- A Babel plugin, so it is unambiguously a build-process tool.
- The
<style jsx>tag placed in the component at whatever nesting level you want to scope to is a clever API. - No nesting support, so selector names get repeated a lot.
Related tools and reference material
- Shopify published research on which library it wanted to switch to.
- Facebook has an unreleased effort apparently called "StyleX"; it isn't open source. A library called "Style9" attempts to match its features, including near-zero runtime, atomic CSS output and the TypeScript experience.
- For atomic authoring, many people favor Tailwind, likely with just-in-time mode. Styled System is a more React-native take, providing styles as preconfigured props, and Twin occupies similar territory.
- Compiled resembles the styled-components API but outputs atomic CSS classes. The author could not get it working.
- The CSS in JS Playground collects examples across libraries, including ones not covered here such as Fela and Radium.
A note on "the TypeScript editor experience": it means the library is written in TypeScript so editors can autocomplete your own definitions — typing <Button color=" in a JSX file should surface your compatible color variants in VS Code.



