Full CSS support for JSX without compromises
7.8k
Stars
267
Forks
83
Open issues
30
Contributors
AI Analysis
styled-jsx is a CSS-in-JS library that provides scoped, component-friendly styling for JSX with full CSS support, working in both server-side and client-side rendering. It's specifically designed for React applications and developers who want encapsulated styles without CSS conflicts. Best suited for React projects prioritizing style isolation and developer experience; not ideal for teams preferring traditional CSS files or other CSS-in-JS approaches like Emotion or styled-components.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Vercel's scoped CSS-in-JSX library remains alive but faces an uphill battle in a mature CSS-in-JS market
styled-jsx provides full, scoped CSS inside JSX components via a Babel/SWC transform, injecting unique classnames at build time to achieve style isolation without runtime overhead. It was built primarily for Next.js users seeking a zero-config, familiar CSS syntax within components. Vercel bundles it as the default CSS-in-JS solution for Next.js (Pages Router), which gives it substantial passive adoption. However, as the ecosystem has shifted toward CSS Modules, Tailwind, and the App Router, its organic growth has stalled. It remains technically functional and actively maintained, but its strategic importance within the Next.js ecosystem has diminished.
Created by Vercel in December 2016 to solve CSS scoping in React SSR contexts. It shipped as the built-in styling solution for Next.js Pages Router, giving it a large captive user base. The project has been stable for years with only maintenance updates.
Growth was almost entirely driven by Next.js adoption rather than standalone interest. As Next.js popularity surged, so did passive styled-jsx usage. However, with Next.js App Router defaulting to CSS Modules and React Server Components discouraging CSS-in-JS at runtime, the pull toward styled-jsx has weakened noticeably since 2022-2023. Stars have flatlined at roughly 7.8k with only 2 gained in the last 7 days.
Strong indirect adoption evidence via Next.js Pages Router, which automatically configures styled-jsx. Millions of Next.js projects have likely used it passively. Direct standalone adoption is less documented. npm download counts would be substantial due to Next.js bundling, though this conflates bundled usage with intentional adoption.
Appears to use a Babel plugin (and SWC transform for Next.js) to perform compile-time CSS extraction and classname injection. Likely generates unique scope hashes per component. Runtime module is reportedly 3kb gzipped and handles style deduplication and SSR flushing. The transform approach means minimal runtime cost compared to fully runtime CSS-in-JS solutions.
not documented in README
Last push was 2026-06-09, approximately 17 days before the evaluation date, indicating the project is actively maintained. Maintenance appears routine — keeping up with dependencies and Next.js compatibility — rather than feature-driven. CI badge is present and active.
ADOPT IF: you are maintaining an existing Next.js Pages Router codebase that already uses styled-jsx and migration cost is not justified. AVOID IF: you are starting a new React or Next.js project — CSS Modules, Tailwind, or Emotion are better-supported defaults with broader community momentum. MONITOR IF: you are tracking whether Vercel continues investing in it as Next.js App Router matures, as the project's long-term strategic role within Vercel's stack is uncertain.
Independent dimensions
Mainstream potential
2/10
Technical importance
6/10
Adoption evidence
6/10
- Declining strategic relevance within Next.js as the App Router and React Server Components ecosystem moves away from runtime CSS-in-JS patterns.
- Babel dependency may create friction as the broader ecosystem moves toward SWC and other non-Babel toolchains, though a SWC plugin appears to exist for Next.js.
- Limited ecosystem growth: plugins, integrations, and community content are unlikely to expand significantly given flat adoption trajectory.
- Dynamic styling capabilities are constrained compared to styled-components or Emotion, which may frustrate developers with complex theming needs.
- Maintainer concentration risk: as a Vercel-owned project primarily maintained in service of Next.js, if Vercel deprioritizes it, community-driven maintenance may not fill the gap.
styled-jsx will likely persist in maintenance mode, kept alive for Next.js Pages Router backward compatibility, but is unlikely to regain growth momentum or become a recommended choice for new projects.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Website
- http://npmjs.com/styled-jsx
- Language
- JavaScript
- License
- MIT
- Last updated
- 1mo ago
- Created
- 117mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Hydration errors when using React Compiler in Next.js
Content Security Policy (CSP) should use the nonce attribute
Feature: Container-Queries support / Stylis update
Bug: cannot add 2 global styles together inside 1 component
ReactDOMServer.renderToPipeableStream
Recent releases
Similar repos
emotion-js/emotion
Emotion is a CSS-in-JS library optimized for high-performance style composition...
styled-components/styled-components
styled-components is a CSS-in-JS library for React that enables scoped, dynamic...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
7.8k | — | JavaScript | 7/10 | 1mo ago |
|
|
18k | — | JavaScript | 8/10 | 2mo ago |
|
|
41.1k | — | TypeScript | 9/10 | 2w ago |
|
|
9.6k | — | JavaScript | 8/10 | 4d ago |
|
|
140.6k | — | JavaScript | 9/10 | 4h ago |
|
|
13.6k | — | TypeScript | 8/10 | 21h ago |
styled-components offers a richer API with theming, dynamic props, and a large ecosystem, but has a higher runtime cost and historically struggled with SSR performance. styled-jsx is lighter and more aligned with plain CSS syntax but lacks the component abstraction model.
Emotion offers both styled and css-prop APIs with strong performance and SSR support. It has broader community adoption and framework-agnostic use. styled-jsx's advantage is its zero-config integration into Next.js; outside that context, Emotion is generally preferred.
CSS Modules are now the de facto standard in Next.js App Router. They offer zero runtime cost, familiar syntax, and broad tooling support. They lack dynamic styling capabilities but cover most use cases, making styled-jsx harder to justify for new projects.
StyleX from Meta takes a more constrained, static-first approach to scoped styles. It is growing in adoption for large-scale apps needing strict style predictability. styled-jsx is less constrained but also less scalable in large codebases.
Tailwind dominates new Next.js project starts. It solves scoping via utility classes rather than CSS-in-JS. Tailwind and styled-jsx serve different mental models, but Tailwind's community momentum makes styled-jsx a less natural starting point for new developers.